title
= 'Pmw.ComboBoxDialog demonstration'
# Import Pmw from this directory tree.
sys
.path
[:0] = ['../../..']
def __init__(self
, parent
):
self
.dialog
= Pmw
.ComboBoxDialog(parent
,
title
= 'My ComboBoxDialog',
buttons
= ('OK', 'Cancel'),
label_text
= 'What do you think of Pmw?',
scrolledlist_items
= ('Cool man', 'Cool', 'Good', 'Bad', 'Gross'))
# Create button to launch the dialog.
w
= Tkinter
.Button(parent
,
text
= 'Show combo box dialog',
w
.pack(padx
= 8, pady
= 8)
result
= self
.dialog
.activate()
print 'You clicked on', result
, self
.dialog
.get()
######################################################################
# Create demo in root window for testing.
if __name__
== '__main__':
exitButton
= Tkinter
.Button(root
, text
= 'Exit', command
= root
.destroy
)
exitButton
.pack(side
= 'bottom')