TomSchimansky / CustomTkinter

A modern and customizable python UI-library based on Tkinter
MIT License
11.58k stars 1.08k forks source link

Change label position of checkbox, switch, radiobutton #628

Open Cromwell1963 opened 2 years ago

Cromwell1963 commented 2 years ago

With regard to the CTkSwitch, CTkRadioButton & CTkCheckBox; is there any way to have the label show on the left of the widget rather than the right? thanks karl

Evolution0 commented 2 years ago

All three use a Label that is within the main widget which has three columns and are set to the last column so are hardcoded to draw on the right.

You would have to dig into the instanced widget and change the grid configuration, I've never tried it personally so can't say for sure its possible. I do know that you could monkey patch CustomTkinter itself to add the option to change orientation though, just add an additional argument in the widgets init, something like justification="E" which you can set to "W" to swap it around, then put an if which just checks justification and sets the column to either 0 or 2 (2 being the default)

Cromwell1963 commented 1 year ago

Thank you for your reply. I guess i will have to work with it.

TomSchimansky commented 1 year ago

I will try to implement an option to change the label position soon.

Cromwell1963 commented 1 year ago

Brilliant, thanks!