in reply to Perl/tk - how to handle screen transitions - can I destroy the main window?
use Tk; $mw = MainWindow->new; $page[0] = $mw->Frame(); $page[1] = $mw->Frame(); $page[0]->Button( -command => sub { setpage(1) }, -text => 'Go Page 2! +' )->pack(); $page[1]->Button( -command => sub { setpage(0) }, -text => 'Back to 1' + )->pack(); $page[0]->pack(); $curpage = 0; MainLoop; sub setpage { my $n = shift; $page[$curpage]->packForget(); $page[$n]->pack(); $curpage = $n; }
|
|---|