fill, expand from tkinter.pack() layout manager
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 -- https://mail.python.org/mailman/listinfo/python-list
Re: fill, expand from tkinter.pack() layout manager
ast nom...@invalid.com a écrit dans le message de news:5458dfc6$0$27505$426a7...@news.free.fr... w.pack(side=LEFT, fill = BOTH) Why is the label w only extended vertically and not horizontally too ? with: w.pack(side=TOP, fill = BOTH) it expand horizontally but not vertically with: w.pack(side=LEFT, fill = BOTH, expand = 1) or w.pack(side=TOP, fill = BOTH, expand = 1) it expand both horizontally and vertically -- https://mail.python.org/mailman/listinfo/python-list
Re: fill, expand from tkinter.pack() layout manager
4 Kasım 2014 Salı 16:16:52 UTC+2 tarihinde ast yazdı: 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 Hi, 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. -- https://mail.python.org/mailman/listinfo/python-list