ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/learning/Tkinter/Python_programing_book/gui3e.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 480 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 #test script from the Programing python book
2     ## Do not run this from Python Win. It crashes it. It runs fine by itself. ie from shell
3     # Binding events... cool.
4    
5     from Tkinter import *
6    
7     def hello(event):
8     print "Press twice to exit."
9    
10     def quit(event):
11     print "Hello, I must be going..."
12     import sys; sys.exit()
13    
14     widget = Button(None, text="Hello event world")
15     widget.pack()
16     widget.bind('<Button-1>',hello)
17     widget.bind('<Double-1>',quit)
18     widget.mainloop()