pack(fill=Y) not working as expected
Beinan Li <[email protected]> Mon, 7 Aug 2017 16:56:46 +0800
| Newsgroups | gmane.comp.python.tkinter |
|---|---|
| Message-ID | <CAPbpa4QvpPvsEn1KDJQME67vbe2u2jHr_teYz1phSTizSd7jxA@mail.gmail.com> |
Hello Tkinter, I was following a book example code as following: import Tkinter as tk root = tk.Tk() tk.Button(root, text="A").pack(side=tk.LEFT, expand=tk.YES, fill=tk.Y) tk.Button(root, text="B").pack(side=tk.TOP, expand=tk.YES, fill=tk.BOTH) tk.Button(root, text="C").pack(side=tk.RIGHT, expand=tk.YES, fill=tk.NONE, anchor = tk.NE) tk.Button(root, text="D").pack(side=tk.LEFT, expand=tk.NO, fill=tk.Y) tk.Button(root, text="E").pack(side=tk.TOP, expand=tk.NO, fill=tk.BOTH) tk.Button(root, text="G").pack(side=tk.BOTTOM, expand=tk.YES, fill=tk.Y) tk.Button(root, text="H").pack(side=tk.TOP, expand=tk.NO, fill=tk.BOTH) tk.Button(root, text="I").pack(side=tk.RIGHT, expand=tk.NO) tk.Button(root, text="J").pack(anchor=tk.SE) root.mainloop() I was expecting to get the result in the attached expected.png, but got what shows in got.png. It seems that the fill option does not work as expected. I tried with Python 2.7.13 on macOS Sierra. What am I missing here? Thanks, Beinan _______________________________________________ Tkinter-discuss mailing list [email protected] https://mail.python.org/mailman/listinfo/tkinter-discuss
expected.png
(image/png, 16 KB) - not displayed
got.png
(image/png, 64.2 KB) - not displayed