| [reply] [d/l] [select] |
Thanks for that suggestion.However, perhaps not.
I just tried by adding $mw->Busy but the GUI was updated. Should this have happened?
| [reply] |
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__
| [reply] [d/l] |
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 makethese effective (so that the new form of the GUIis obtained) at one go?
| [reply] |
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.
| [reply] |