_________________________________________________________________
busy release window ?window?...
busy configure window ?option value?...
busy forget window ?window?...
busy isbusy ?pattern?
busy status window
busy windows ?pattern?
_________________________________________________________________
The busy command lets you make Tk widgets busy. This means that user interactions such as button clicks, moving the mouse, typing at the keyboard, etc. are ignored by the widget. You can also set a special cursor (like a watch) which overrides the widget's normal cursor, providing feedback that the application (widget) is temporarily busy.
When a widget is made busy, all of the widgets in its window hierarchy also become busy. It's easy then to make an entire panel of widgets busy by simply making the uppermost widget (such as ".") busy. This is far easier and much more efficient than recursively traversing the widget hierarchy, disabling each widget and re-configuring its cursor.
The busy command can also be used in many cases instead of Tk's grab command. Unlike grab which directs all user interaction to one widget, the busy command allows more than one widget to be active (for example, a "cancel" dialog and a "help" button) while the other widgets are busy.
frame .top
button .top.button; canvas .top.canvas pack .top.button .top.canvas
pack .top
. . .
busy hold .top
update
All the widgets within .top (including .top) are now busy. The update command insures that busy command has a chance to effect.
When the application is no longer busy, you can allow user interaction again by the release operation.
busy release .top
You can change the busy cursor using the configure operation.
busy configure .top -cursor "watch"
Finally, when you no longer need to make the widget busy anymore, invoke the forget operation to free any resources allocated.
busy forget .top
Destroying the widget also cleans up any resources allocated by the busy command.
busy hold window ?option value?...
Makes the widget window (and its descendants in the Tk window hierarchy) busy. Window must be a valid path name of a Tk widget. After idle tasks are processed, the widget will be blocked from user interactions. All device events in the widget window and its descendants will be ignored. Typically update should be called immediately afterward to insure that the hold operation is in effect before the application starts its processing. The following configuration options are valid:
Please note that the option database is referenced through window. For example, if the widget .frame is to be made busy, the busy cursor can be specified for it by either option command:
option add *frame.busyCursor gumby option add *Frame.BusyCursor gumby
busy forget window ?window?...
Releases resources allocated by the busy command for window, including the InputOnly window. User events will again be received again by window. Busy resources are also released when window is destroyed. Window must be the name of a widget specified in the hold operation, otherwise an error is reported.
busy isbusy ?pattern?
Returns the pathnames of all widget windows which are currently busy. If a pattern is given, the path names of busy widgets matching pattern are returned.
busy release window ?window?...
Restores user interactions to the widget window again. This differs from the forget operation in that the InputOnly window is not destroyed, but simply unmapped. Window must be the name of a widget specified in a hold operation, otherwise an error is reported.
busy status window
Returns the status of a widget window previously made busy. An error is reported if window was never made busy, or the forget operation was invoked (i.e. does not currently have a InputOnly window associated with it). If window is presently can not receive user interaction, 1 is returned, otherwise 0.
busy windows ?pattern?
Returns the pathnames of all widget windows which have previously been made busy (i.e. an InputOnly is allocated and associated with the widget). It makes no difference if the window is currently busy ot not. If a pattern is given, the path names of busy widgets matching pattern are returned.
busy hold .frame.canvas
bind .frame.canvas_Busy <Enter> { ... }
Typically, the InputOnly window is a sibling of the widget's window. The name of the InputOnly window will be "widget_Busy" where widget is the name of the widget made busy. In the above example, the pathname of the InputOnly window is ".frame.canvas_Busy" The exception is when the widget is a toplevel window (such as "."). Then the InputOnly window is a child of the widget's window and the name of the widget will be "widget._Busy" where widget is the name of the widget made busy. In the following example, the pathname of the InputOnly window is "._Busy"
busy hold .
bind ._Busy <Enter> { ... }
busy hold .frame
label .dummy
focus .dummy
update
The above example moves the focus from .frame immediately after invoking the hold so that no keyboard events will be relayed to windows under the hierarchy of .frame.