f



RE: couldn't connect to display ":0" #2

I think the problem is that John is confusing two
technologies. Tk is used to interact with a GUI
locally (yes, it can display remotely using X-windows
if the DISPLAY variable is set to another machine).
Contrast this to CGI which is used in a web server
environment where there is no display; rather the
output is sent back to the requester's browser.
So unless you are testing pure locally (i.e. not 
running under the web server but rather from a
command line), this *should* fail.

That is why I would say that mixing Tk and CGI
is likely a conceptual error on John's part.

--
Mike Arms


-----Original Message-----
From: EXT-Gomez, Ignacio [mailto:ignacio.gomez@boeing.com]
Sent: Monday, June 07, 2004 3:16 PM
To: tk list
Subject: RE: couldn't connect to display ":0"

I think that is not a problem with your script, 
but with the environment variable DISPLAY that 
may be set incorrectly. Or if you are running that 
script from a session window that doesn't let 
graphics (spawning windows) though, that is another 
possibility.

Are you running your script from your local host 
or telnet'ed / rsh'ed ?

Iggs


-----Original Message-----
From: John Larson [mailto:jwlarson3rd@yahoo.com]
Sent: Monday, June 07, 2004 4:15 PM
To: tk list
Cc: Nick Ing-Simmons
Subject: couldn't connect to display ":0"

help
when I run this program:
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
use lib  '/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux';
use Tk;
my $main = new MainWindow; ###barfs here###
$main->Label(-text => 'Hello, world!')->pack;
$main->Button(-text => 'Quit', -command => sub{exit} )->pack;
MainLoop;

I recieve the following error
Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at
/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux/Tk/MainWindo
w.pm line 55. [Mon Jun 7 13:11:43 2004] test.cgi: MainWindow->new() at
/home/bthcraft/cgi-bin/test.cgi line 6 

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
0
Arms
6/7/2004 9:38:36 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

0 Replies
1167 Views

Similar Articles

[PageSpeed] 20

Reply:

Similar Artilces:

RE: couldn't connect to display ":0"
This is a multi-part message in MIME format. ------_=_NextPart_001_01C44CD4.90830B30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I think that is not a problem with your script, but with the environment = variable DISPLAY that may be set incorrectly. Or if you are running that script from a session window that doesn't let = graphics (spawning windows) though, that is another possibility. =20 Are you running your script from your local host or telnet'ed / rsh'ed ? =20 Iggs -----Original Message----- From: J...

ptkdb running from Apache couldn't connect to display "localhost:0.0"
I am having a problem running ptkdb when invoked by a local httpd server. The script below works ok and will fire up ptkdb ok from a bash shell: #!/usr/bin/perl -w -d:ptkdb #!/usr/bin/perl -wT $|++; # for debugger when httpd invokes CGI #sub BEGIN {$ENV{DISPLAY} = "localhost:0.0"; }; use strict; print "Content-type: text/html\n\n"; use CGI; use FindBin; my $scriptdir = "$FindBin::Bin"; my $tmpldir = "$scriptdir/../templates/"; use lib "/home/owain/www/v2/perl-lib"; my $q = new CGI; my $t = new_template("hell...

couldn't connect to display ":0"
--0-2076467981-1086639284=:72215 Content-Type: text/plain; charset=us-ascii help when I run this program: #!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use lib '/home/bthcraft/cgi-bin/lib/lib/perl5/site_perl/5.8.0/i386-linux'; use Tk; my $main = new MainWindow; ###barfs here### $main->Label(-text => 'Hello, world!')->pack; $main->Button(-text => 'Quit', -command => sub{exit} )->pack; MainLoop; I recieve the following error Mon Jun 7 13:11:43 2004] test.cgi: couldn't connect to display ":0" at /hom...

exmh 2.7.0: OK, 2.7.2: 'tkerror: can't read "pgp(pgp6,path)": no ...'
Hiya, I just upgraded to Mandriva 2007.0, which comes with exmh 2.7.2. I tried that, but I got one of those traceback windows and this in the xterm where I started exmh: exmh: tkerror: can't read "pgp(pgp6,path)": no ... exmh: tkerror: can't read "exwin(mtext)": no s ... I rebuilt my 2.7.0 exmh from my previous OS. It runs just fine. I'm running tcl-8.4.13 & tk-8.4.13, both shipped with Mandriva, if that matters. What could the problem be? Thanks.... -- PLEASE post a SUMMARY of the answer(s) to your question(s)! Show Windo...

Re: Mandis Quotes (aka retiring """ and ''') #2
Russell Nelson notes: > = > Choose poor examples, and then criticize them as poor choices? > = true enough, but the suggested scheme introduces another variable into the = language syntax; I might always make good choices <wink> on what delimiter = I choose, but I might also end up working on code written by someone else w= ho makes less good choices. Or vice versa. = > Exactly. It really would be better to have one(1) string literal > which can quote anything without reverting to backslashing. Why one? > Simpler parsing, simpler learning of the language, fewe...

Fedora 2 "couldn't add command channel 127.0.0.1#953: not found" [solution]
On a laptop, not connected to any network, nor to Internet. Installed Fedora Core 2 from CD's with book "Red Hat Fedora Linux 2 Bible". Selected various web services and Gnome stuff. Booted. As root, started service "named". Result was a "chrooted" ("jailed") service, in "/var/named/chroot". - - - - - What works: 1. Created a file "/var/www/html/index.html", asked browser to show "http://localhost": that page displays. What doesn't work: 1. "host localhost" - times out, can't find a...

error: "couldn't execute "date": no such file or directory" in Tk
hi, i am using the following code in a tcl script with the TK framework, and i get the above error on executing the file main file.. main file --------------- #!c:/tcl/bin/tclsh label .l -text "click to execute" button .b -text "Execute" -command "exec_script" proc exec_script {} { set inp 1 source sss.tcl puts $inp } pack .l .b sss.tcl ----------------------------- #!c:/tcl/bin/tclsh set inp 0 puts $inp set d [exec date] The error i get is "couldn't execute "date": no such file or directory" I am using Tk with Tcl and ...

lynx 'browser' can't do "<?xml version="1.0" encoding="utf-8"?>"
lynx is lighteningly fast to fetch a set of pages [via a script] via dump > fileID. But [my current version] doesn't render the 'style' of: "<?xml version="1.0" encoding="utf-8"?>" What is this new "xml" crap ? Will it likely take over the older *.html ? Thanks for any info, == Chris Glur. news@absamail.co.za wrote in news:1172596265.663611@vasbyt.isdsl.net: > lynx is lighteningly fast to fetch a set of pages [via a script] via > dump > fileID. > > But [my current version] doesn't ...

Re: Tk's lack of "chrome" (prompted by Re: Tk::FunkyButton ?) #2
Dean Arnold wrote: > 3) Have you considered the browser based alternatves ? (Forgive > the buzzwords) People are doing some amazing things w/ AJAX, > and with the availablity of XUL and/or XAML (or whatever MSFT > is calling Avalon these days), the browser seems to be the direction > everyone is headed. Followup: for an idea whats possible w/ Javascript + XUL, see http://www.hacksrus.com/~ginda/venkman/screenshots/venkman-20030427.gif (Venkman is a Javascript debugger (IDE, actually) for Mozilla/Firefox browsers) Lots more screenshots at http://www.ha...

Re: Tk and xdefaults on windows (prompted by Re: Tk's lack of "chrome") #2
Nick Ing-Simmons <nick@ing-simmons.net> writes: > Hans Jeuken <haje@toneel.demon.nl> writes: > >> I well thought out set of xresources can help X11 > >> for sure. Windows might be a little more tricky > >> as core tk (as currently ported) aims to use "native look". > >> > > > >A couple of years ago i had a W98 machine and i was > >sharing my linux home folder on that machines through > >samba. When launching a perl/Tk script from that > >shared drive on the W98 it used the settings in > ...

(mapcar 'quote '("1" "2" "3" "4"))
(mapcar 'quote '("1" "2" "3" "4")) returns ((quote "4") (quote "4") (quote "4") (quote "4")) Interesting and (for me) unexpected. Because (mapcar 'read '("1" "2" "3" "4")) returns (1 2 3 4) and (mapcar 'princ '("1" "2" "3" "4")) gives 1234("1" "2" "3" "4") Why isn't (mapcar 'quote '("1" "2" "3" "4&q...

Re: Help, rather stuck: Should it take 22 ms to (via Visa) write &quot;ISET 2&quot; then &quot;ISET 0&quot; to an instrument? (to a Kikusui electronic load if you're curious)
Dennis hi: I hope you are able to gime a hand with KIKUSUI PLZ-30F electronic load. 1. I'm talking to the instrument via GPIB and it communicates. 2. It doesn't respond on a settings commands - change from CC to CR mode, etc. 3. There are 3 modules in a frame - one master and two slaves. 4. I'm suspicious I'm missing something, and... this company does not have techsupport...??? 5. Their drivers have entirely different format from SCPI and I have no use to them. 6. There is an IVI driver - but I didn't try it yet. &nbsp; Best, Oleg Finodeyev ...

Re: Can't locate object method "OPEN" via package "Tk::Event::IO"
I answered my own question. I needed to undefine the callback near the close of the filehandle. eg close $fh; $mw->fileevent( $fh, 'readable', '' ); ----- Original Message ----- From: "Tim Harsch" <harsch1@llnl.gov> To: "PTK" <ptk@lists.stanford.edu> Sent: Thursday, August 21, 2003 5:48 PM Subject: Can't locate object method "OPEN" via package "Tk::Event::IO" > I'm trying to set up a basic queue of processes to run. Here is an example > where I create 4 sleep jobs, submit NUM_PROCS...

Re: What's wrong with this: street_n=addr1_1|" "||addr2||" "||addr3||" "||addr4||" "||addr5 #2
On Thu, 4 Mar 2004 12:55:20 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hi, >I wanted to remove the first zero from 0416 E. BAILEY 101, but not from >0 S 356 MADISON. >I ran the following code and I have problem with the line: >------------------------ >street_n=addr1_1|" "||addr2||" "||addr3||" "||addr4||" "||addr5; >---------------------- > Hi, Duck-Hye, You need to add one more bar character after addr1_1 for the above line. For removing the leading zeros, try the following rx solution. Cheers, Chang <s...

Web resources about - RE: couldn't connect to display ":0" #2 - comp.lang.perl.tk

Resources last updated: 2/7/2016 3:27:43 AM