Take the 2-minute tour ×

Is there any way to get the label of a GtkCheckButton or GtkRadioButton to wrap when its parent container is resized small enough so the label won't fit on one line?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can access button's child widget — it's a GtkLabel in default setup, — and set various properties on it, e.g. wrap. However, since there is no height-for-width layout negotiation in GTK+ 2.x, what you want exactly can be difficult / close to impossible to achieve. Note that you can also replace the button's child if you want.

share|improve this answer
I'd forgotten it was also a GtkContainer! Thanks! –  ptomato Jun 30 '10 at 23:43

I also got that working this way (using GtkSharp)

RadioButton rb;

/* Initialize the radio button ... */

//Set its wrap mode
(rb.Child as Gtk.Label).Wrap = true;
(rb.Child as Gtk.Label).LineWrap = true;
(rb.Child as Gtk.Label).LineWrapMode = Pango.WrapMode.Word;
share|improve this answer

Your Answer


