GtkCheckButton - how to put label on the other side of the button?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Due to a very specific style guide for a project I have to adjust Gtk radio and checkbuttons to show their text label on the _left_ side of the button like this:
apple []
pears []
grape []
Gtks default puts the button on the left side and the textlabel on the right.
Did I miss some incredibly simple flag or do I have to derive a custom button from ToggleButton to archieve that? (If so - some illustrating pseudo code would be appreciated..)
I've tried some hack with not showing the default label of a radio/checkbutton and instead putting my own label on the left side - but as both button-types have a clickable area around them where usally the label is set, this is ugly and not really working.
I'm no expert on this subject, but I did play around with radio buttons in Glade, and can suggest a work-around. Make the radio button's label an empty string, and pack a separate label adjacent to it, all within a hbox. The relevant code generated by glade:
As mentioned it's not really that nice because of Gtk sets a clickable area around the label. This is very useful, because you don't have to acutally hit the (tiny) button itself but just the label to activate the check/radio button..
Now I have my clickable area still on the right side of my buttons and my label left-sided.
You could change the size of the window, or modify the size of the columns and rows of your widgets. Also, you can set the labels so that they aren't "clickable", lol, i don't know if that's the right word. Anyways, hope that helps.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.