import tkinter as tk
from tkinter import messagebox
from PIL import Image, ImageTk
# إعداد النافذة
root = tk.Tk()
root.title("الشرطة أصدقاؤنا")
root.geometry("400x500")
# تحميل صورة كرتونية (تأكد من وجود صورة باسم 'police_cartoon.png' في نفس المجلد)
try:
img = Image.open("police_cartoon.png")
img = img.resize((200, 200))
photo = ImageTk.PhotoImage(img)
img_label = tk.Label(root, image=photo)
img_label.pack(pady=10)
except:
img_label = tk.Label(root, text="(صورة الشرطي)", font=("Arial", 16))
img_label.pack(pady=10)
# رسالة ترحيبية
title = tk.Label(root, text="مرحباً بك!", font=("Arial", 24, "bold"))
title.pack(pady=5)
subtitle = tk.Label(root, text="تعلم كيف تساعد الشرطة وتحترم القوانين", font=("Arial", 14))
subtitle.pack(pady=5)
# زر تفاعلي
def show_message():
messagebox.showinfo("نصيحة", "الشرطة هنا لحمايتك، لا تخف منهم، بل كن صديقهم!")
btn = tk.Button(root, text="اضغط لمعرفة فائدة الشرطة", font=("Arial", 14), command=show_message)
btn.pack(pady=20)
# تشغيل البرنامج
root.mainloop()