Open emcek opened 1 year ago
I have never use state
on tabview, but on button, entry and slider.
I didn't wrote state = tk.ACTIVE
I wrote state = "disabled"
(for disable) or state = "normal"
(for enable) and it worked.
So try for enable:
tabview.configure(state="normal")
and for disable;
tabview.configure(state="disabled")
You might have to change the color manually if you want different colors.
I want disable only one tab from CTkTabview
not whole CTkTabview
widget...
This working perfectly ok: tabview.configure(state="disabled") tabview.configure(state=tk.DISABLED)
Anyway, from tkinter\constants.py
:
...
DISABLED='disabled'
...
state = "disabled"
== state = tk.DISABLED
they are exactly same thing....
@emcek, now you can do that only through access to the protected variables. In your case the solution is:
tabview._segmented_button._buttons_dict["Tab2"].configure(state=customtkinter.DISABLED)
@TomSchimansky, it would be nice to add method that allows to do that legally
@emcek, now you can do that only through access to the protected variables. In your case the solution is:
tabview._segmented_button._buttons_dict["Tab2"].configure(state=customtkinter.DISABLED)
@TomSchimansky, it would be nice to add method that allows to do that legally
It is a pity that I came after many years and this feature is not available yet. Also this feature should be in "segmentedbutton". https://customtkinter.tomschimansky.com/documentation/widgets/segmentedbutton
It would be useful to be able disable/enable state tab(s) of CTkTabview:
Result: