in reply to Delaying changes to widget layout with Perl/Tk

You can withdraw the $mw while reconfiguring it, and pop up a "please wait" toplevel, something like below. Otherwise, you can packForget all the widgets, rebuild them without packing, then pack them all at once.
#!/usr/bin/perl use warnings; use strict; use Tk; my $config; my $mw = MainWindow->new(-title=>"Demo"); $mw->withdraw; get_config($mw); MainLoop; sub setup_mw{ my $label = $mw->Label(-text=> $config)->pack(); $mw->deiconify; $mw->raise; } sub get_config { my $parent = shift; #collect your config here $config = 'hoohah'; my $win = $parent->Toplevel(-title=>'config window'); my $Bttn = $win->Button( -text=>"I'm done configuring, so press me", -command=> sub{ $win->destroy; setup_mw(); } )->pack( ); } __END__

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Delaying changes to widget layout with Perl/Tk
by merrymonk (Hermit) on Sep 24, 2007 at 19:05 UTC
    I would prefer not to minimise the GUI.
    I am using the grid method to place the widgets.
    Is there a way I can set the grid values but then make
    these effective (so that the new form of the GUI
    is obtained) at one go?
      I use pack almost exclusively, but have you read "perldoc Tk::grid" ? There is gridForget and gridPropagate, etc, so you should be able to find a way.

      I'm not really a human, but I play one on earth. Cogito ergo sum a bum