#!/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;
In reply to Re: Perl Tk - Go back to main window from the child window
by zentara
in thread Perl Tk - Go back to main window from the child window
by priyaviswam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |