summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter/matt/packer-simple.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/tkinter/matt/packer-simple.py')
-rw-r--r--Demo/tkinter/matt/packer-simple.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/Demo/tkinter/matt/packer-simple.py b/Demo/tkinter/matt/packer-simple.py
index 4519a72..7773cae 100644
--- a/Demo/tkinter/matt/packer-simple.py
+++ b/Demo/tkinter/matt/packer-simple.py
@@ -7,23 +7,20 @@ class Test(Frame):
def createWidgets(self):
# a hello button
- self.QUIT = Button(self, {'text': 'QUIT',
- 'fg': 'red',
- 'command': self.quit})
-
- self.QUIT.pack({'side': 'left', 'fill': 'both'})
+ self.QUIT = Button(self, text='QUIT', foreground='red',
+ command=self.quit)
+ self.QUIT.pack(side=LEFT, fill=BOTH)
+ self.hi_there = Button(self, text='Hello',
+ command=self.printit)
+ self.hi_there.pack(side=LEFT)
- self.hi_there = Button(self, {'text': 'Hello',
- 'command' : self.printit})
- self.hi_there.pack({'side': 'left'})
+ # note how Packer defaults to side=TOP
- # note how Packer defaults to {'side': 'top'}
-
- self.guy2 = Button(self, {'text': 'button 2'})
+ self.guy2 = Button(self, text='button 2')
self.guy2.pack()
- self.guy3 = Button(self, {'text': 'button 3'})
+ self.guy3 = Button(self, text='button 3')
self.guy3.pack()
def __init__(self, master=None):