moked has asked for the wisdom of the Perl Monks concerning the following question:
my $log = MainWindow->new(title=>"Who is logged on which tester"); my $log1 = $log -> Frame; $listbox = $log1->Scrolled("Listbox", "-font" => 14, "-width" => 51, "-height" => 37, "-background" => 'lightgreen'); foreach $n (@output){ $listbox-> insert('end',"$n");} $listbox -> pack(-fill => 'both',-expand => 1); $logU=$log1->Frame; $logU->Button( -text => 'Refresh', -background => 'lightgreen', -activebackground => '#0000ff', -activeforeground => '#80ffff', -command => sub{$Refr = 1;$log -> destroy;})->pack(-side => 'l +eft',qw/-ipadx 4 -pady 2/ ,-expand => 1); $logU->Button( -text => 'OK', -background => 'lightgreen', -activebackground => '#0000ff', -activeforeground => '#80ffff', -command => \&exit)->pack(-side => 'right',qw/-ipadx 14 -pady +2/,-expand => 1); $logU->pack(-fill=>'both',-expand=>1,-side=>'bottom'); $log1 -> pack(-fill =>'both',-expand => 1); $log->withdraw; $log->update; my $xpos = int(($log->screenwidth - $log->width ) / 2); my $ypos = int(($log->screenheight - $log->height) / 3);#upper thi +rd instead of middle $log->geometry("+$xpos+$ypos"); $log->deiconify; # Show the window again $log-> bind ('<Key-Return>','destroy'); $log-> bind ('<Key-Escape>','destroy'); $log->protocol('WM_DELETE_WINDOW',sub {$log->destroy;X_pressed();s +leep(2);exit;}); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tk folding frame
by zentara (Cardinal) on Aug 13, 2008 at 15:36 UTC |