Here is my code: I added small animation when menu label coming out...
def menu_pannel():
x = menu_bg.winfo_x()
if x < 0:
x += 5
menu_bg.place(x=x)
search_btn.place(x=x)
path_btn.place(x=x)
window.after(10, menu_pannel)
else:
def move_left(event):
x = menu_bg.winfo_x()
if x > -80:
x -= 5
menu_bg.place(x=x)
search_btn.place(x=x)
path_btn.place(x=x)
window.after(10, lambda: move_left(event))
#----------===============[HERE IS THE PROBLEM]===============----------
menu_bg.bind('<Leave>', move_left)
search_btn.bind('<Enter>', lambda e: menu_bg.unbind('<Leave>'))
path_btn.bind('<Enter>', lambda e: menu_bg.unbind('<Leave>'))
#----------===================================================----------
menu_bg=customtkinter.CTkLabel(window, text="",bg_color="#0e0e0f", width=width/12, height=height+250)
menu_bg.place(x=-80,y=-1)
search_btn=customtkinter.CTkButton(window, image=search_img, text='', bg_color="#0e0e0f", hover_color=theme, fg_color="#0e0e0f", corner_radius=0, width=width/12, height=height/13, command=menu_pannel)
search_btn.place(x=-80, y=100)
path_btn=customtkinter.CTkButton(window, image=folder_img, text='', bg_color="#0e0e0f", hover_color=theme, fg_color="#0e0e0f", corner_radius=0, width=width/12, height=height/13, command=menu_pannel)
path_btn.place(x=-80, y=200)
Here is the GUI with the error!
The following icons are buttons that appear with a black label and move back when the user leaves the mouse pointer from the label. That's the basic concept in this program. But it also move back when the user tries to interact with the buttons. I tried numerous times to fix this problem but no success!