Complex label for listboxrow/radiobutton


The listboxrow items for my listbox have three items of text of variable & unpredictable length. I’d like to format the rows so that each of the three text items appears in the same position as on other rows. I could probably do that with an hbox containing three separate labels.

However I’d also like each row to behave as a single selectable radio button and I’m not sure how to combine those elements.

Any ideas?


You can use a GtkSizeGroup to ensure that certain UI elements request the same space.

Thanks for the reply Emmanuele,

However the issue is not just the width of each of the three labels, but how to attach the three labels to the radio button - I think it can only accept a single label.

In the meantime I’ve tried adding padding (using text spaces) into a single label to give the appearance that the three text fields, when viewed along with the other listbox rows, are arranged in columns. It requires a monospace font to look right and also feels a bit hackish - so I’m still happy to receive any other suggestions for better ways to achieve this.


For completeness - my initial concern was that having three labels in a box would not work as the contents of a listboxrow. I thought that selection of a row would be tied to one or other of the labels rather than all three.

Since my other solution was so unappealing, I revisited this issue and found that my earlier concerns were unfounded i.e. the three boxed labels appear and act as a single row - selection anywhere in the row works regardless of which label is underneath the mouse pointer.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.