Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Embedded xterm problem in perl tk

by vr786 (Sexton)
on Jan 06, 2011 at 05:23 UTC ( [id://880748]=perlquestion: print w/replies, xml ) Need Help??

vr786 has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, I am getting the Warning message while executing the embedded xterm script, iam not getting exactly where iam going wrong can any one help me

Warning: Tried to connect to session manager, None of the authentication protocols specified aresupported Warning: Cannot convert string "nil2" to type FontStruct xterm: cannot load font -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1

#!/usr/bin/perl -w use strict; use Tk; my $mw = MainWindow->new(); my $canv = $mw->Canvas(-bg => 'lightsteelblue', -relief => 'sunken', -width => 550, -height => 350)->pack(-expand => 1, -fill => 'both'); my $xtermWidth = 400; my $xtermHeight = 150; my $xtermContainer = $canv->Frame(-container => 1); my $xtid = $xtermContainer->id(); my ($xtId) = sprintf hex $xtid; my $dcontitem = $canv->createWindow(275,175, -window => $xtermContainer, -width => $xtermWidth+100, -height => $xtermHeight, -state => 'normal'); my $label = $canv->createText( 275,10, -text => "Hide xterm", ); $canv->Tk::bind("<Button-1>", \&hideShow); my $width = $xtermWidth; my $height = $xtermHeight; $mw->Button(-text => "Exit", -command => [sub{Tk::exit}] )->pack( ); my $tl; #used to mask xterm system("xterm -into $xtId &"); MainLoop(); sub hideShow { if ($canv->itemcget($label, -text) =~ /Hide/) { $canv->itemconfigure($label, -fill => 'white', -text => "Show xterm"); $tl = $mw->Toplevel(-use=>$xtId ); } else { $canv->itemconfigure($label, -fill => 'black', -text => "Hide xterm"); $tl->withdraw; } }

Replies are listed 'Best First'.
Re: Embedded xterm problem in perl tk
by zentara (Archbishop) on Jan 06, 2011 at 15:04 UTC
    tried to connect to session manager, None of the authentication protocols specified are supported

    What Window Manager are you using? Some window managers are not fully compliant to the ICCWM standards. See Inter_client_communication standard

    It is likely your window manager dosn't support the "into xid" option.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://880748]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 02:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found