Merhaba her ayarlar() komutunu kullandıgımda ekrana menü açıyor ama ben zaten menü açıksa birdaha açılmasını istemiyorum bunu nasıl engellerim ?
def ayarlar():
ayarlar_menü = tk.Toplevel()
ayarlar_menü.geometry("250x250")
ayarlar_menü.resizable(width=FALSE, height=FALSE)
ayarlar_menü.wm_attributes("-topmost", 0)
ayarlar_menü.config(bg="steelblue")
ayarlar_menü.title("Ayarlar")
ayarlar_menü.iconbitmap(r'logo.ico')
b1 = tk.IntVar()
b2 = tk.IntVar()
b3 = tk.IntVar()
checkbutton = Checkbutton(ayarlar_menü,onvalue=1,offvalue=0,bg="steelblue",variable=b1,command=ayarlar,fg="ghost white",font=('Gelasio',10,'bold'),text="Her zaman üstte tut",selectcolor="steelblue").place(x=30,y=10)
checkbutton2 = Checkbutton(ayarlar_menü,onvalue=1,offvalue=0,bg="steelblue",variable=b2,command=ayarlar,fg="ghost white",font=('Gelasio',10,'bold'),text="Tarayıcıyı gizle",selectcolor="steelblue").place(x=30,y=40)
checkbutton3 = Checkbutton(ayarlar_menü,onvalue=1,offvalue=0,bg="steelblue",variable=b3,command=ayarlar,fg="ghost white",font=('Gelasio',10,'bold'),text="Otomatik başlatıcı",selectcolor="steelblue").place(x=30,y=70)
checkbutton4 = Checkbutton(ayarlar_menü,onvalue=1,offvalue=0,bg="steelblue",variable=b3,command=ayarlar,fg="ghost white",font=('Gelasio',10,'bold'),text="Log sistemi",selectcolor="steelblue").place(x=30,y=100)
ayarlar_menü.mainloop()