summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/tkinter')
-rwxr-xr-xDemo/tkinter/guido/hello.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Demo/tkinter/guido/hello.py b/Demo/tkinter/guido/hello.py
new file mode 100755
index 0000000..237204f
--- /dev/null
+++ b/Demo/tkinter/guido/hello.py
@@ -0,0 +1,17 @@
+# Display hello, world in a button; clicking it quits the program
+
+import sys
+from Tkinter import *
+
+def main():
+ root = Tk()
+ button = Button(root)
+ button['text'] = 'Hello, world'
+ button['command'] = quit_callback # See below
+ button.pack()
+ root.mainloop()
+
+def quit_callback():
+ sys.exit(0)
+
+main()