1 title = 'Pmw.ComboBoxDialog demonstration'
3 # Import Pmw from this directory tree.
5 sys.path[:0] = ['../../..']
11 def __init__(self, parent):
13 self.dialog = Pmw.ComboBoxDialog(parent,
14 title = 'My ComboBoxDialog',
15 buttons = ('OK', 'Cancel'),
17 combobox_labelpos = 'n',
18 label_text = 'What do you think of Pmw?',
19 scrolledlist_items = ('Cool man', 'Cool', 'Good', 'Bad', 'Gross'))
20 self.dialog.withdraw()
22 # Create button to launch the dialog.
23 w = Tkinter.Button(parent,
24 text = 'Show combo box dialog',
26 w.pack(padx = 8, pady = 8)
29 result = self.dialog.activate()
30 print 'You clicked on', result, self.dialog.get()
32 ######################################################################
34 # Create demo in root window for testing.
35 if __name__ == '__main__':
40 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
41 exitButton.pack(side = 'bottom')