Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_frame_size.py
- from Tkinter import *
- def small(event):
- fra.configure(width=300)
- def middle(event):
- fra.configure(width=600)
- def big(event):
- fra.configure(width=900)
- root = Tk()
- fra = Frame(root,width=300,height=100,bg="green")
- but1 = Button(root,text="300x100")
- but2 = Button(root,text="600x100")
- but3 = Button(root,text="900x100")
- but1.bind("<Button-1>",small)
- but2.bind("<Button-1>",middle)
- but3.bind("<Button-1>",big)
- fra.grid(row=0,column=0,columnspan=3)
- but1.grid(row=1,column=0)
- but2.grid(row=1,column=1)
- but3.grid(row=1,column=2)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement