Skip to content

Instantly share code, notes, and snippets.

@sehrishnaz
Created April 7, 2021 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sehrishnaz/0a8b9a13f6dca7776071a44ea2f88385 to your computer and use it in GitHub Desktop.
Save sehrishnaz/0a8b9a13f6dca7776071a44ea2f88385 to your computer and use it in GitHub Desktop.
Layout Managers in Tkinter - .pack() geometry manager
import tkinter as tk
window = tk.Tk()
# First Frame
frame1 = tk.Frame(master=window, width=300, height=200, bg="grey")
frame1.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
# Second Frame
frame2 = tk.Frame(master=window, width=200, bg="green")
frame2.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
# Third Frame
frame3 = tk.Frame(master=window, width=100, bg="black")
frame3.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
window.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment