This method creates a pop-up
Dialog widget. The
structure is the same except for the frame title (the
title argument) and the help text (the
# - - - M e n u B a r . _ _ d i a l o g def __dialog ( self, title, text ): """Pop up a Dialog widget. [ (title is the frame title as a string) and (text is the help text as a multiline string containing newlines and tab characters) -> desktop := desktop with a Dialog widget displaying title and text ] """
Dialog widget for pop-up menus comes
Dialog.py module, part of
Tkinter. Unfortunately, this widget is poorly
documented; the author learned to use it by reading
examples and reading its source code.
title argument appears as the
default argument specifies which
button is the default choice; in our case, it's the
only button, button number zero.
strings argument is a tuple of button
titles. We need only one button, a button that gets rid of the pop-up.
bitmap argument specifies which
pictograph appears on the pop-up; the
"info" bitmap is a big gray question mark.
text argument is the body text for
the pop-up. This text may include newlines (
"\n") and tabs (
lines will be folded automatically. Note that Python
automatically merges adjacent string constants.
Dialog ( self, default=0, strings=('Dismiss',), bitmap='info', title=title, text=text )
One drawback of these prefabricated
widgets is that you can't override the ugly font. This
is a candidate for replacement someday. Note that the
widget grabs the focus, so the user can't do anything
back in the main window until they dismiss the pop-up.