summaryrefslogtreecommitdiff
path: root/pyohio2012/src/canvas.py
diff options
context:
space:
mode:
authorunknown <Jeff@Spartan.(none)>2012-07-28 11:34:24 -0400
committerunknown <Jeff@Spartan.(none)>2012-07-28 11:34:24 -0400
commita5fdf514ed77acd1ae4bf1c3442d750a921d8735 (patch)
tree393d78f6a90400de74cae6831dcb287549cf99e8 /pyohio2012/src/canvas.py
parent70af2d6ecf3323874bac8c7e7e90a2ae68188824 (diff)
downloadpresentations-a5fdf514ed77acd1ae4bf1c3442d750a921d8735.tar.gz
presentations-a5fdf514ed77acd1ae4bf1c3442d750a921d8735.zip
Added PyOhio2012 presentation source code
Diffstat (limited to 'pyohio2012/src/canvas.py')
-rw-r--r--pyohio2012/src/canvas.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/pyohio2012/src/canvas.py b/pyohio2012/src/canvas.py
new file mode 100644
index 0000000..54b4c72
--- /dev/null
+++ b/pyohio2012/src/canvas.py
@@ -0,0 +1,29 @@
+from tkinter import *
+from tkinter.ttk import *
+
+class TkCanvas():
+ def __init__(self, root):
+
+ self.frame = Frame(root)
+ self.canvas = Canvas(self.frame)
+ self.canvas.grid(row=0, column=0)
+
+ self.draw_rect()
+
+ quit_button = Button(self.frame, text='Quit', command=self.quit)
+ quit_button.grid(row=1, column=0, sticky=(S,E))
+
+ self.frame.pack(fill=BOTH, expand=True)
+
+ def draw_rect(self):
+ self.canvas.create_rectangle((100,100), (30,40))
+
+ def quit(self):
+ self.frame.quit()
+
+if __name__ == '__main__':
+ root = Tk()
+
+ app = TkCanvas(root)
+
+ root.mainloop() \ No newline at end of file