Pmw.ComboBoxDialog() - selection dialog displaying a list and an entry field
A combobox dialog is a dialog window which displays a list and an entry field which can be used to prompt the user for a value.
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.
dropdown = 0
. By default, this component is a Pmw.ComboBox.
(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.
size()
method. Without this explicit forwarding, the size()
method (aliased to grid_size()
) of the hull would be invoked,
which is probably not what the programmer intended.
class Demo: def __init__(self, parent): # Create the dialog. self.dialog = Pmw.ComboBoxDialog(parent, title = 'My ComboBoxDialog', buttons = ('OK', 'Cancel'), defaultbutton = 'OK', combobox_labelpos = 'n', label_text = 'What do you think of Pmw?', scrolledlist_items = ('Cool man', 'Cool', 'Good', 'Bad', 'Gross')) self.dialog.withdraw() # Create button to launch the dialog. w = tkinter.Button(parent, text = 'Show combo box dialog', command = self.doit) w.pack(padx = 8, pady = 8) def doit(self): result = self.dialog.activate() print('You clicked on ' + result + ' ' + self.dialog.get())
Pmw 2.1 -
31 Dec 2020
- Home
Manual page last reviewed: 18 May 2002