#!/usr/bin/perl -- use strict; use warnings; use Tk qw/ tkinit /; my $mw = tkinit; my $done; my $bu = $mw->Button( -text => "clickme", -command => sub { $done = "I am done " . gmtime; } , )->pack; for( 1 .. 3){ # $mw->deiconify; # $mw->raise; $mw->Popup; $bu->focus; $mw->waitVariable(\$done); ## like mainloop until $done changes print "I am $done again\n"; $mw->withdraw; ## hide, no more mainloop sleep 1; }
In reply to Re: Perl Tk unable to return from MainLoop when implemented in a subroutine (tk modal mainwindow popup deiconify withdraw Show without MainLoop)
by Anonymous Monk
in thread Perl Tk unable to return from MainLoop when implemented in a subroutine
by ngocanh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |