From 89cb67bb642ee958d9f095728c99e943e994ca54 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 30 Jul 1996 18:57:18 +0000 Subject: Updated for Python 1.4 --- Demo/tkinter/matt/placer-simple.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'Demo/tkinter/matt/placer-simple.py') diff --git a/Demo/tkinter/matt/placer-simple.py b/Demo/tkinter/matt/placer-simple.py index 724cb97fdf0..b7cae7e59dc 100644 --- a/Demo/tkinter/matt/placer-simple.py +++ b/Demo/tkinter/matt/placer-simple.py @@ -3,8 +3,7 @@ from Tkinter import * # This is a program that tests the placer geom manager 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!' @@ -14,27 +13,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') # place it so the upper left hand corner of # the frame is in the upper left corner of # the parent - f.place({'relx' : '0.0', - 'rely' : '0.0'}) + f.place(relx=0.0, rely=0.0) # 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('', do_motion) -- cgit v1.2.3