Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Interrupting a loop

by etj (Curate)
on Jul 28, 2024 at 13:43 UTC ( [id://11160789]=note: print w/replies, xml ) Need Help??


in reply to Re: Interrupting a loop
in thread Interrupting a loop

To emphasise a point in choroba's excellent thought: when you want to juggle multiple events (a signal/button-click AND elapsed time), you need to stay in the idiom of the relevant event loop. In Tk, that's why you'd want to do the time-delay with Tk::after, not with sleep, so the event loop can quietly also watch for the button-click etc and react; sleep just suspends the whole process until the OS sends it a SIGALRM.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11160789]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-09-13 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (21 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.