Fix an amazing number of typos & malformed sentences reported by Detlef
[python/dscho.git] / Demo / tkinter / matt / entry-simple.py
blobcf82b89ce9b07343f7f39a514755d661559a7c88
1 from Tkinter import *
2 import string
4 # This program shows how to use a simple type-in box
6 class App(Frame):
7 def __init__(self, master=None):
8 Frame.__init__(self, master)
9 self.pack()
11 self.entrythingy = Entry()
12 self.entrythingy.pack()
14 # and here we get a callback when the user hits return. we could
15 # make the key that triggers the callback anything we wanted to.
16 # other typical options might be <Key-Tab> or <Key> (for anything)
17 self.entrythingy.bind('<Key-Return>', self.print_contents)
19 def print_contents(self, event):
20 print "hi. contents of entry is now ---->", self.entrythingy.get()
22 root = App()
23 root.master.title("Foo")
24 root.mainloop()