Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Perl/TK Main Window Destroy

by converter (Priest)
on Jul 17, 2003 at 13:56 UTC ( #275216=note: print w/replies, xml ) Need Help??


in reply to Perl/TK Main Window Destroy

Tk is an event-driven GUI toolkit, and provides numerous ways to hook into the event loop. You might want to use the after method (documented in the Tk::after man page). Example:

#!/usr/bin/perl use Tk; $timeout = 8000; $m = tkinit; # prevent pack() sizing the Toplevel down so # that we can still reach the controls $m->packPropagate(0); $m->Label( -text =>'hi', )->pack; $m->Button( -text=>'Ok', -command => sub { $m->destroy; }, )->pack; # invoke a callback after $timeout msecs $after = $m->after( $timeout, [$m, 'destroy'], ); MainLoop;

conv

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://275216]
help
Chatterbox?
[Perl300]: ok, and for future if I want to use local box for something similar, then will Email::Sender:: Simple be a good choice?
[1nickt]: It's a framework that allows you to specify the Transport agent to whatever you want. You could even write your own.
[1nickt]: Perl300 More doc
[hippo]: In that case, use Net::SMTPS and also encrypt your content before you send it eg. with Crypt::GPG

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-10-17 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (234 votes). Check out past polls.

    Notices?