in reply to Re: Perl/Tk exit trouble?
in thread Perl/Tk exit trouble?
The Perl-Tk version is 804.027 and here is one of the scripts which misbehaves; as you can see, it's an exercise answer from one of the earlier chapters -
#!/usr/bin/perl -w # 123ex1 - Combination of Entry and Label widgets. # Another segmentation fault; that's interesting. # # Setting the Label width forces the widget to scroll, # otherwise it will expand the window x-wise to # accomodate the extra text. Try -wraplength also. use Tk; use strict; my $message; my $mw = MainWindow->new; $mw->title("Label following Entry"); $mw->Label(-textvariable => \$message, -width => 40) ->pack(-side => 'bottom', -fill => 'x',); my $e = $mw->Entry(-textvariable => \$message) ->pack(-expand => 1, -fill => 'x'); MainLoop;
I agree, the book is well out of date, but it was a cheap 'pre-loved' deal on Amazon. I've already give up on the book as a tutorial. Thanks for the advice about GTk2 - I may just follow that up.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl/Tk exit trouble?
by zentara (Cardinal) on Jan 10, 2010 at 12:33 UTC | |
by Hengist (Pilgrim) on Jan 10, 2010 at 15:43 UTC | |
by zentara (Cardinal) on Jan 11, 2010 at 12:50 UTC | |
|
Re^3: Perl/Tk exit trouble?
by stefbv (Priest) on Jan 09, 2010 at 21:32 UTC | |
by Hengist (Pilgrim) on Jan 09, 2010 at 21:55 UTC |