1 title = 'Demonstration of Pmw megawidget destruction'
3 # Import Pmw from this directory tree.
5 sys.path[:0] = ['../../..']
11 def __init__(self, parent):
12 # Create and pack an EntryField.
13 self.entryfield = Pmw.EntryField(parent,
14 command = self.execute,
15 value = 'Press <Return> to destroy me',
17 self.entryfield.pack(fill='x', expand=1, padx=10, pady=5)
19 self.entryfield.component('entry').focus_set()
22 print 'Return pressed, destroying EntryField.'
23 self.entryfield.destroy()
25 ######################################################################
27 # Create demo in root window for testing.
28 if __name__ == '__main__':
33 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
34 exitButton.pack(side = 'bottom')