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