How to align switch with the text + change the colour of switch when it is checked #539
Unanswered
Josborne123
asked this question in
Q&A
Replies: 1 comment 3 replies
-
@Josborne123 I guess it's due to the font, either change the font or increase the size of CTkSwitch. Eg:
You can add this in your if switch.get()==1:# On value
switch.configure(button_color="red") # new color
else:
switch.configure(button_color="#6c43cd") # old color |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For some reason when using CTkSwitch the actual switch part is not aligned with the text part, it is slightly above. I was wondering how to fix this. I've tried to use
anchor="center"
but it doesn't change anythingMy code for the switch is
switch = customtkinter.CTkSwitch(window, text="Mute", command=mute_switch, text_font=("Comic Sans MS bold", 11), bg_color="#e88b2e", button_color="#6c43cd", fg_color="#b8d2d4", button_hover_color="#a589e8") switch.place(relx=0.11, rely=0.21, anchor="center")
Also how do I change the blue colour of the switch when the switch is on to another colour? (shown below)

Beta Was this translation helpful? Give feedback.
All reactions