in reply to Tk and blocking loops

Look up "Tk::fileevent":
Tk::fileevent - Execute a callback when a filehandle becomes readable or writable SYNOPSIS $widget->fileevent(fileHandle,readable?,callback?) $widget->fileevent(fileHandle,writable?,callback?) DESCRIPTION This command is used to create file event handlers. A file event handler is a binding between a filehandle and a callback, such that the callback is evaluated whenever the filehandle becomes readable or writable. File event han­ dlers are most commonly used to allow data to be received from another process on an event-driven basis, so that the receiver can continue to interact with the user while waiting for the data to arrive...

Replies are listed 'Best First'.
Re: Re: Tk and blocking loops
by pg (Canon) on Mar 09, 2003 at 03:51 UTC
    graff is right. Basically, Tk would get all the events, and those events are no longer delivered to your code directly.

    Another example is that you would not be able to call sleep in your Tk scripts, if you want to do something periodically, you would have to call after.