summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter/matt/packer-and-placer-together.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-07-30 18:57:18 (GMT)
committerGuido van Rossum <guido@python.org>1996-07-30 18:57:18 (GMT)
commit89cb67bb642ee958d9f095728c99e943e994ca54 (patch)
tree24f176f21636ab7b3a5cd1cec9948b4e3a1315ff /Demo/tkinter/matt/packer-and-placer-together.py
parentc30e95f4b0fa266df678fe4e307ff6c19a3f9e73 (diff)
downloadcpython-89cb67bb642ee958d9f095728c99e943e994ca54.zip
cpython-89cb67bb642ee958d9f095728c99e943e994ca54.tar.gz
cpython-89cb67bb642ee958d9f095728c99e943e994ca54.tar.bz2
Updated for Python 1.4
Diffstat (limited to 'Demo/tkinter/matt/packer-and-placer-together.py')
-rw-r--r--Demo/tkinter/matt/packer-and-placer-together.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/Demo/tkinter/matt/packer-and-placer-together.py b/Demo/tkinter/matt/packer-and-placer-together.py
index 64b3821..4ceec54 100644
--- a/Demo/tkinter/matt/packer-and-placer-together.py
+++ b/Demo/tkinter/matt/packer-and-placer-together.py
@@ -5,8 +5,7 @@ from Tkinter import *
def do_motion(event):
- app.button.place({'x' : event.x,
- 'y' : event.y})
+ app.button.place(x=event.x, y=event.y)
def dothis():
print 'calling me!'
@@ -16,27 +15,20 @@ def createWidgets(top):
# and the window containing is 400x400. We do this
# simply to show that this is possible. The rest of the
# area is inaccesssible.
- f = Frame(top, {'width' : '200',
- 'height' : '200',
- 'bg' : 'green'})
+ f = Frame(top, width=200, height=200, background='green')
# note that we use a different manager here.
# This way, the top level frame widget resizes when the
# application window does.
- f.pack({'fill' : 'both',
- 'expand' : 1})
+ f.pack(fill=BOTH, expand=1)
# now make a button
- f.button = Button(f, {'fg' : 'red',
- 'text' : 'amazing',
- 'command' : dothis})
-
+ f.button = Button(f, foreground='red', text='amazing', command=dothis)
+
# and place it so that the nw corner is
# 1/2 way along the top X edge of its' parent
- f.button.place({'relx' : '0.5',
- 'rely' : '0.0',
- 'anchor' : 'nw'})
-
+ f.button.place(relx=0.5, rely=0.0, anchor=NW)
+
# allow the user to move the button SUIT-style.
f.bind('<Control-Shift-Motion>', do_motion)