fill, expand from tkinter.pack() layout manager

ast nomail at invalid.com
Tue Nov 4 09:16:32 EST 2014


Hi

I dont really understood how "fill" and "expand"
works with  layout manager tkinter.pack()

Example:

from tkinter import *
root = Tk()
w = Label(root, text="Red", bg="red", fg="white")
w.pack(side=LEFT, fill = BOTH)

Here is the result:
http://cjoint.com/?0Kepj1E3Tv3

Why is the label "w" only extended vertically and not horizontally too ?
I specified "fill = BOTH" so it should extend in both direction.

(I know that with expand = 1, it will expand in both direction) 

thx




More information about the Python-list mailing list