From a5fdf514ed77acd1ae4bf1c3442d750a921d8735 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 28 Jul 2012 11:34:24 -0400 Subject: Added PyOhio2012 presentation source code --- pyohio2012/src/without_ttk.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 pyohio2012/src/without_ttk.py (limited to 'pyohio2012/src/without_ttk.py') diff --git a/pyohio2012/src/without_ttk.py b/pyohio2012/src/without_ttk.py new file mode 100644 index 0000000..b5da854 --- /dev/null +++ b/pyohio2012/src/without_ttk.py @@ -0,0 +1,39 @@ +from Tkinter import * + +class WithoutTtk(): + def __init__(self, root): + + self.frame = Frame(root) + + self.build_window() + + self.frame.pack(fill=BOTH) + + menubar = Menu(root) + root['menu'] = menubar + + menu_file = Menu(menubar) + menu_file.add_command(label="Quit", command=self.quit) + + menubar.add_cascade(menu=menu_file, label='File') + + + def build_window(self): + label = Label(self.frame, text="How do I look?") + label.pack(side=TOP) + + button_bad = Button(self.frame, text="Terrible", command=self.quit) + button_bad.pack(side=LEFT) + + button_good = Button(self.frame, text="Not too shabby", command=self.quit) + button_good.pack(side=RIGHT) + + def quit(self): + self.frame.quit() + +if __name__ == '__main__': + root = Tk() + + app = WithoutTtk(root) + + root.mainloop() -- cgit v1.2.3