3 # This is a program that tests the placer geom manager in conjunction with
4 # the packer. The background (green) is packed, while the widget inside is placed
8 app
.button
.place({'x' : event
.x
,
14 def createWidgets(top
):
15 # make a frame. Note that the widget is 200 x 200
16 # and the window containing is 400x400. We do this
17 # simply to show that this is possible. The rest of the
18 # area is inaccesssible.
19 f
= Frame(top
, {'width' : '200',
23 # note that we use a different manager here.
24 # This way, the top level frame widget resizes when the
25 # application window does.
26 f
.pack({'fill' : 'both',
30 f
.button
= Button(f
, {'fg' : 'red',
34 # and place it so that the nw corner is
35 # 1/2 way along the top X edge of its' parent
36 f
.button
.place({'relx' : '0.5',
40 # allow the user to move the button SUIT-style.
41 f
.bind('<Control-Shift-Motion>', do_motion
)
46 app
= createWidgets(root
)
47 root
.geometry("400x400")
48 root
.maxsize(1000, 1000)