Friday 8 February 2008

Tkinter layout/alignment control

The following example uses packer management for the Tkinter layout.

Reference: http://docs.python.org/lib/node695.html


from Tkinter import *

root=Tk()

b3=Button(root, text='click me!!')
b3.pack(padx=10,pady=5)

b1=Button(root, text='click me',padx=10,pady=5)
b1.pack(side = "left")

b2=Button(root, text='click me',padx=10,pady=5)
b2.pack(side = 'right',expand = 1)

b4=Button(root, text='click me',padx=10,pady=5)
b4.pack()


root.mainloop()




Powered by ScribeFire.

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter