Class GetKeypressDialog
source code
??-109 --+
|
ToplevelDialog --+
|
GetKeypressDialog
Open a dialog box which returns when a valid key is pressed.
Arguments are:
master - a Tkinter widget (defaults to None)
title - a string for the title bar of the widget
text - a string to display as the text in the body of the dialog
key_list - a list of acceptable keys, e.g. ['q','1','2','<Return>']
The following example will print whatever character was pressed:
d = GetKeypressDialog(key_list=['q','1','2','<Return>','<Escape>'])
print d.result
The implementation is somewhat obscure because a new Tk/Tcl
interpreter may be created if this Dialog is called with no
master widget.