tk/wait

Wait for variable to change or window to be destroyed

(tk/wait 'variable name), (tk/wait 'visibility name), (tk/wait 'window name)
The tk/wait command waits for one of several things to happen, then it returns without taking any other actions.

The return value is always an empty string.

If the first argument is variable, then the second argument is the name of a global variable and the command waits for that variable to be modified.

If the first argument is visibility, then the second argument is the name of a window and the tk/wait command waits for a change in its visibility state (as indicated by the arrival of a VisibilityNotify event). This form is typically used to wait for a newly-created window to appear on the screen before taking some action.

If the first argument is window, then the second argument is the name of a window and the tk/wait command waits for that window to be destroyed. This form is typically used to wait for a user to finish interacting with a dialog box before using the result of that interaction.

While the tk/wait command is waiting it processes events in the normal fashion, so the application will continue to respond to user interactions.

If an event handler invokes tk/wait again, the nested call to tk/wait must complete before the outer call can complete.


Corresponding Tcl/Tk command:

tkwait ...

© Author | Home | Sitemap