Pack control to Top, left and right : Pack « Tkinker « Python Tutorial






Pack control to Top, left and right
from Tkinter import *
     
def greeting():
    print 'Hello stdout world!...'
     
win = Frame()    
win.pack()
Label(win,  text='Hello container world').pack(side=TOP)          
Button(win, text='Hello', command=greeting).pack(side=LEFT)
Button(win, text='Quit',  command=win.quit).pack(side=RIGHT)
     
win.mainloop()








18.23.Pack
18.23.1.Pack control to the topPack control to the top
18.23.2.Pack a framePack a frame
18.23.3.pack(expand=YES, fill=BOTH)pack(expand=YES, fill=BOTH)
18.23.4.Set control's properties through dictionary syntaxSet control's properties through dictionary syntax
18.23.5.Frame Widgets and CenteringFrame Widgets and Centering
18.23.6.Pack control to Top, left and rightPack control to Top, left and right
18.23.7.Add equivalent pack windowAdd equivalent pack window
18.23.8.Add label and resizingAdd label and resizing