Skip to content

Instantly share code, notes, and snippets.

@sehrishnaz
Created April 7, 2021 07:15
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/d286e87485f9d2c1a2870d30de882a36 to your computer and use it in GitHub Desktop.
Save sehrishnaz/d286e87485f9d2c1a2870d30de882a36 to your computer and use it in GitHub Desktop.
Layout Managers in Tkinter - .place() geometry manager
import tkinter as tk
window = tk.Tk()
frame = tk.Frame(master=window, width=300, height=100)
frame.pack()
label1 = tk.Label(master=frame, text="Position at (10, 10)", bg="grey")
label1.place(x=10, y=10)
label2 = tk.Label(master=frame, text="Position at (100, 100)", bg="green")
label2.place(x=100, y=50)
label3 = tk.Label(master=frame, text="Position at (200, 200)", bg="yellow")
label3.place(x=200, y=80)
window.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment