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
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to