import tkinter as tk
root = tk.Tk()
root.title("Pack Demo 3 - Corner Anchors")
root.geometry("500x400")
# Настройка шрифта и цвета (тот самый розово-фиолетовый)
custom_font = ("Arial", 12, "bold")
special_color = "orchid" # Или "#DA70D6"
# 1. Квадратик в ВЕРХНЕМ ПРАВОМ углу
# anchor='ne' (North-East — Северо-Восток)
# padx и pady создают те самые "выступы" от края
tk.Label(root, text="Top Right", bg=special_color, fg="white",
width=12, height=3, font=custom_font).pack(anchor='ne', padx=15, pady=15)
# 2. Квадратик в НИЖНЕМ ЛЕВОМ углу
# side='bottom' опускает область упаковки вниз
# anchor='sw' (South-West — Юго-Запад) прижимает влево
tk.Label(root, text="Bottom Left", bg="orange", fg="white",
width=12, height=3, font=custom_font).pack(side='bottom', anchor='sw', padx=15, pady=15)
root.mainloop()