diff options
| author | unknown <Jeff@Spartan.(none)> | 2012-07-28 11:34:24 -0400 |
|---|---|---|
| committer | unknown <Jeff@Spartan.(none)> | 2012-07-28 11:34:24 -0400 |
| commit | a5fdf514ed77acd1ae4bf1c3442d750a921d8735 (patch) | |
| tree | 393d78f6a90400de74cae6831dcb287549cf99e8 /pyohio2012/src/notebook.py | |
| parent | 70af2d6ecf3323874bac8c7e7e90a2ae68188824 (diff) | |
| download | presentations-a5fdf514ed77acd1ae4bf1c3442d750a921d8735.tar.gz presentations-a5fdf514ed77acd1ae4bf1c3442d750a921d8735.zip | |
Added PyOhio2012 presentation source code
Diffstat (limited to 'pyohio2012/src/notebook.py')
| -rw-r--r-- | pyohio2012/src/notebook.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/pyohio2012/src/notebook.py b/pyohio2012/src/notebook.py new file mode 100644 index 0000000..326d0c7 --- /dev/null +++ b/pyohio2012/src/notebook.py @@ -0,0 +1,36 @@ +from tkinter import * +from tkinter.ttk import * + +class TkNotebook(): + def __init__(self, root): + + self.frame = Frame(root) + self.notebook = Notebook(self.frame) + + f1 = Frame(self.notebook, width=200, height=100) + f2 = Frame(self.notebook, width=200, height=100) + self.notebook.add(f1, text="Page 1") + self.notebook.add(f2, text="Page 2") + + self.label = Label(self.frame, text="A Notebook on the left") + + # Layout + self.frame.grid(row=0, column=0, sticky=(N, S, E, W)) + self.notebook.grid(row=0, column=0, sticky=(N, S, E, W)) + self.label.grid(row=0, column=1, sticky=(E,)) + + # Resize rules + root.columnconfigure(0, weight=1) + root.rowconfigure(0, weight=1) + self.frame.columnconfigure(0, weight=2) + self.frame.rowconfigure(0, weight=2) + + def quit(self): + self.frame.quit() + +if __name__ == '__main__': + root = Tk() + + app = TkNotebook(root) + + root.mainloop()
\ No newline at end of file |
