fill, expand from tkinter.pack() layout manager
mfthguven at gmail.com
Tue Nov 4 15:42:29 CET 2014
4 Kasım 2014 Salı 16:16:52 UTC+2 tarihinde ast yazdı:
> I dont really understood how "fill" and "expand"
> works with layout manager tkinter.pack()
> from tkinter import *
> root = Tk()
> w = Label(root, text="Red", bg="red", fg="white")
> w.pack(side=LEFT, fill = BOTH)
> Here is the result:
> 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)
Packing widgets splits frame into equal areas with expand=1. if expand="false", widgets don't touch each other and widgets save their own dimension.
More information about the Python-list