November 1999
Intermediate to advanced
832 pages
19h 28m
English
When you create your own dialogs, you need to understand keyboard focus, focus grabs, and how to wait for the user to finish with a dialog. Here is the general structure of your code when creating a dialog:
# Create widgets, then focus $toplevel grab $toplevel tkwait window $toplevel
This sequence of commands directs keyboard focus to the toplevel containing your dialog. The grab forces the user to interact with the dialog before using other windows in your application. The tkwait command returns when the toplevel window is destroyed, and this automatically releases the grab. This assumes that the button commands in the dialog destroy the toplevel. The following sections explain these steps in more detail, and Example 36-1 on ...
Read now
Unlock full access