Oct-05-2023, 03:34 AM
hello.
At present time,I need to mouse click on the slider1 manually to activate it (to change transparency of a top level window.
How do I activate it programmatically?
I have tried to code slider1.set(0.0) but that might be just the position of slider1?
Visualy its positioned at 0.0 as result, but its not activated.I have also tried to set focus before setting value.
Whats needed here to activate it?
At present time,I need to mouse click on the slider1 manually to activate it (to change transparency of a top level window.
How do I activate it programmatically?
I have tried to code slider1.set(0.0) but that might be just the position of slider1?
Visualy its positioned at 0.0 as result, but its not activated.I have also tried to set focus before setting value.
Whats needed here to activate it?
#ยจ--function to set transparency in top level window def slider1_event(value): top.attributes("-alpha",slider1.get()) slide1val.configure(text=str(round(value,2))) #-- set characteristics and command function slider1 = customtkinter.CTkSlider(window, fg_color="red", from_=0.0, to=1.0, number_of_steps=20, command=slider1_event) slider1.place(x=1590,y=40) #-- trying desperate to activate slider1: slider1.focus_set() #slider1.set(0.5) #slider1.set(0.0) #---label to show value of slider1--------- slide1val= customtkinter.CTkLabel(window, width=50,font=("Ariel",16,"bold"),text_color="#000000",fg_color="#f0f0f0", text="", justify=("center")) slide1val.place(x=1800,y=35)