3
# This is a program that tests the placer geom manager
6
app.button.place(x=event.x, y=event.y)
11
def createWidgets(top):
12
# make a frame. Note that the widget is 200 x 200
13
# and the window containing is 400x400. We do this
14
# simply to show that this is possible. The rest of the
15
# area is inaccesssible.
16
f = Frame(top, width=200, height=200, background='green')
18
# place it so the upper left hand corner of
19
# the frame is in the upper left corner of
21
f.place(relx=0.0, rely=0.0)
24
f.button = Button(f, foreground='red', text='amazing', command=dothis)
26
# and place it so that the nw corner is
27
# 1/2 way along the top X edge of its' parent
28
f.button.place(relx=0.5, rely=0.0, anchor=NW)
30
# allow the user to move the button SUIT-style.
31
f.bind('<Control-Shift-Motion>', do_motion)
36
app = createWidgets(root)
37
root.geometry("400x400")
38
root.maxsize(1000, 1000)