Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Using sub after MainLoop with Tk

by merrymonk (Hermit)
on Sep 21, 2007 at 08:07 UTC ( #640294=perlquestion: print w/replies, xml ) Need Help??
merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

With Perl/Tk I want to run a subroutine immediately after MainLoop has been ‘used’.
I found I can do this by adding a bind on to the main window that was activated whenever
the cursor was moved. This had the desired result. However, if there a more elegant way of achieving this?

Replies are listed 'Best First'.
Re: Using sub after MainLoop with Tk
by strat (Canon) on Sep 21, 2007 at 08:37 UTC

    Try $mw->after( 500, \&Callback ) before calling MainLoop (see perldoc Tk::After for further details)

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

      Great! That worked just as I wanted it to.
      Many thanks.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://640294]
Approved by GrandFather
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-06-23 04:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.