import tkinter as tk
from PIL import Image, ImageTk
okno = tk.Tk()
okno.title("Lustereczko")
okno.geometry("600x400") # Ustawienie rozmiaru okna
# Kolory
light_pink = "#FFC0CB"
dark_pink = "#FF69B4"
okno.configure(bg=light_pink)
def check():
wynik_label.config(text="TY")
obrazek_lusterka = Image.open("lusterko.png")
obrazek_lusterka = obrazek_lusterka.resize((100, 100))
obrazek_lusterka_tk = ImageTk.PhotoImage(obrazek_lusterka)
etykieta = tk.Label(
okno,
text="Lustereczko, powiedz przecie, kto jest najpiękniejszy w świecie?",
wraplength=500,
padx=10, pady=10,
bg=light_pink,
font=("Segoe Script", 20)
)
etykieta.pack(pady=20)
frame = tk.Frame(okno, bg=light_pink)
frame.pack(pady=20)
lusterko_label = tk.Label(frame, image=obrazek_lusterka_tk, bg=light_pink)
lusterko_label.pack(side=tk.LEFT, padx=10)
sprawdzam_button = tk.Button(
frame,
text="SPRAWDZAM",
command=check,
bg=dark_pink,
fg="white",
font=("Segoe Script", 20)
)
sprawdzam_button.pack(side=tk.LEFT)
wynik_label = tk.Label(
okno,
text="",
wraplength=500,
padx=10, pady=10,
bg=light_pink,
font=("Segoe Script", 52)
)
wynik_label.pack(pady=20)
okno.mainloop()