| Previous | Next
Time DelaysThere are times when you'll want to be able to delay the program a bit before going on, or maybe you'll want to execute the same command every minute. For complete details, see "Anatomy of the MainLoop" and "Images and Animations". To have the program sleep for x number of milliseconds, call $widget->after( You almost never want to do this, as the event loop is blocked. To specify a callback that will be called after so many milliseconds instead of waiting, send a callback as the second argument to $id = $widget->after( If you want to execute a subroutine after the program has been idle for a while, call $id = $widget->afterIdle( To cancel the call to $widget->afterCancel($id); # You can also do this: $id->cancel; You can have the program repeatedly call the same callback by using the $widget->repeat( If you destroy |