g0n has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Tk; my $mw = MainWindow->new(); my $frame = $mw->Frame->pack(); populate(); $frame->Button(-command=>\&recompose)->pack(); MainLoop; sub recompose { $frame->destroy(); $frame = $mw->Frame->pack; populate() } sub populate { for (1..10) { $frame->Label(-text=>$_)->pack(); } }
clicking the button makes the main window resize itself to absolute minimal size (so the numbers can't be seen). To see the numbers the window has to be manually resized. Is this supposed to happen? Is there a call I can make to get the MainWindow to programmatically resize based on its new contents?
TIA
Update: liverpole has pointed out by /msg that he isn't having this problem, and at that point I suddenly remember I'm running cvs Tk on Perl 5.9.5, which might explain the odd behaviour (OS is Debian Etch). Does anyone else not see the numbers 1..10 after clicking on the button? I've reworded the question a bit to try and make the problem clearer.
Update: zentara has rightly pointed out that I probably shouldn't be doing this anyway.
--------------------------------------------------------------
"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk Mainwindow resizing after child destroyed
by zentara (Archbishop) on Oct 09, 2007 at 15:29 UTC | |
by g0n (Priest) on Oct 09, 2007 at 15:58 UTC | |
Re: Tk Mainwindow resizing after child destroyed
by liverpole (Monsignor) on Oct 09, 2007 at 14:30 UTC | |
Re: Tk Mainwindow resizing after child destroyed
by cmv (Chaplain) on Oct 09, 2007 at 14:34 UTC | |
Re: Tk Mainwindow resizing after child destroyed
by hangon (Deacon) on Oct 09, 2007 at 18:04 UTC |