from Tkinter import *
from tkMessageBox import *
class EntryDemo( Frame ):
def __init__( self ):
Frame.__init__( self )
self.pack( expand = YES, fill = BOTH )
self.master.title( "Testing Entry Components" )
self.master.geometry( "325x100" )
self.frame1 = Frame( self )
self.frame1.pack( pady = 5 )
self.text4 = Entry( self.frame1, name = "text4", show = "*" )
self.text4.insert( INSERT, "Hidden text" )
self.text4.bind( "<Return>", self.showContents )
self.text4.pack( side = LEFT, padx = 5 )
def showContents( self, event ):
theName = event.widget.winfo_name()
theContents = event.widget.get()
showinfo( "Message", theName + ": " + theContents )
EntryDemo().mainloop()