Pmw.TextDialog() - a dialog displaying a scrolled text
A text dialog is a dialog window which displays a text message to the user along with one or more buttons to press.
activate()
. The default is None.
If the value of command is not callable, the default behaviour
is to deactivate the window if it is active, or withdraw the
window if it is not active. If it is deactivated, deactivate()
is called with the button name or None as described above. The default is None.
deactivate()
. The default is None.
activate()
method to control whether the
window is made transient during modal dialogs. See the
activate()
method. The default is 'parent'.
(hull_borderwidth = 1, hull_relief = 'raised')
. By default, this component is a Pmw.ButtonBox.
(borderwidth = 1, relief = 'raised')
. By default, this component is a tkinter.Frame.
bbox()
method. Without this explicit forwarding, the bbox()
method (aliased to grid_bbox()
) of the hull would be invoked,
which is probably not what the programmer intended.
class Demo: def __init__(self, parent): # Create the dialog. dialog = Pmw.TextDialog(parent, scrolledtext_labelpos = 'n', title = 'My TextDialog', defaultbutton = 0, label_text = 'Lawyer jokes') dialog.withdraw() dialog.insert('end', jokes) dialog.configure(text_state = 'disabled') # Create button to launch the dialog. w = tkinter.Button(parent, text = 'Show text dialog', command = dialog.activate) w.pack(padx = 8, pady = 8) jokes = """ Q: What do you call 5000 dead lawyers at the bottom of the ocean? A: A good start! Q: How can you tell when a lawyer is lying? A: His lips are moving. Q: Why won't sharks attack lawyers? A: Professional courtesy. Q: What do have when a lawyer is buried up to his neck in sand? A: Not enough sand. Q: How do you get a lawyer out of a tree? A: Cut the rope. Q: What is the definition of a shame (as in "that's a shame")? A: When a bus load of lawyers goes off a cliff. Q: What is the definition of a "crying shame"? A: There was an empty seat. Q: What do you get when you cross the Godfather with a lawyer? A: An offer you can't understand. Q. What do lawyers use as contraceptives? A. Their personalities. Q. What's brown and black and looks good on a lawyer? A. A doberman. Q. Why are lawyers buried 12 feet underground? A. Deep down their good. Q. What's the difference between a catfish and a lawyer? A. One's a slimy scum-sucking scavenger, the other is just a fish. """
Pmw 2.1 -
31 Dec 2020
- Home
Manual page last reviewed: 18 May 2002