This is the message you should get if you did manage to connect to the X server, but the window was then killed for some reason (using xkill on the window it creates will produce this message for example), you probably aren't trapping it because it's occuring sometime after your eval. This code does work if the display is wrong or X is not available...
#!/usr/bin/perl -w use strict; use Tk; my $mw; eval { $mw = MainWindow->new; }; if($@) { print "Using text only\n"; undef $mw; } if($mw) { $mw->MainLoop; } else { print "Text version here\n"; }
In reply to Re: Handle Tk "X connection broken" gracefully?
by jasonk
in thread Handle Tk "X connection broken" gracefully?
by ndwg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |