This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman.
It was last updated in 2013 and is unmaintained. [More info]
Once you import the
you can create any of these seven common types of pop-up
menu by calling functions from this table.
In each case, the
is a string to be displayed in the top of the
window decoration. The
argument is a string that
appears in the body of the pop-up window; within this
string, lines are broken at newline (
arguments may be any of these choices.
Which button should be the default choice? If you do not specify this option, the first button (“OK”, “Yes”, or “Retry”) will be the default choice.
To specify which button is the default choice, use
is one of these constants defined in
Selects which icon appears in the pop-up. Use an
argument of the form
is one of these constants
If you don't specify this option, the pop-up
appears above your root window. To make the pop-up
appear above some child window
W, use the argument
Each of the “
functions returns a value that depends on which button
the user pushed to remove the pop-up.
all return a
True for “OK” or
“No” or “Cancel” choices.
u'yes' for “Yes”, or
u'no' for “No”.