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 text argument).
# - - - 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 ]
"""
The Dialog widget for pop-up menus comes
from the 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.
The title argument appears as the
window title.
The default argument specifies which
button is the default choice; in our case, it's the
only button, button number zero.
The strings argument is a tuple of button
titles. We need only one button, a button that gets rid of the pop-up.
The bitmap argument specifies which
pictograph appears on the pop-up; the "info" bitmap is a big gray question mark.
The text argument is the body text for
the pop-up. This text may include newlines ("\n") and tabs ("\t"). Long
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 Dialog
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.