I have:
try: # In order to be able to import tkinter for
import tkinter as tk # either in python 2 or in python 3
except ImportError:
import Tkinter as tk
if __name__ == '__main__':
root = tk.Tk()
rgb = {'red', 'green', 'blue'}
frames = dict()
for color in rgb:
frames[color] = tk.Frame(root, height=64, width=64, bg=color)
frames['red'].grid(row=0, column=0)
frames['green'].grid(row=1, column=0)
frames['blue'].grid(row=1, column=1)
root.mainloop()
which uses grid
for its layout. How can I have the same, L shaped, layout using only pack
instead and without using additional widgets?
Frames
' parent(not necessarily a top-level) will have only those 3 Frames
as children. Ideally the layout should be resizeable.