in reply to Perl Tk - Go back to main window from the child window

I think all you need is withdraw, deiconify, and raise.
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; my $top = $mw->Toplevel(); $top->configure(-title=>'Fruit Menu'); my $ls_show_fruit = $top->Scrolled('Listbox', -relief=>'groove', -width=>'20', -height=>5, -scrollbars=>'se' , -selectmode =>'single' )->pack(-side=>'left',-anchor=>'sw'); $ls_show_fruit->insert('end',"apples"); $ls_show_fruit->insert('end',"oranges"); $ls_show_fruit->insert('end',"peaches"); $top->Button(-text => 'Ok', -command => sub{ $top->withdraw; $mw->deiconify; $mw->raise; })->pack(); $top->withdraw; $mw->Button(-text=> 'select_fruit', -command => sub{ $top->deiconify; $top->raise; $mw->withdraw; })->pack; MainLoop;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh