CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Change label position of checkbox, switch, radiobutton

Open Cromwell1963 opened this issue 2 years ago • 4 comments

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

Cromwell1963 avatar Nov 15 '22 16:11 Cromwell1963

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)

Evolution0 avatar Nov 20 '22 04:11 Evolution0

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

Cromwell1963 avatar Nov 22 '22 16:11 Cromwell1963

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

TomSchimansky avatar Dec 02 '22 12:12 TomSchimansky

Brilliant, thanks!

Cromwell1963 avatar Jan 12 '23 09:01 Cromwell1963