Title pretty much says it all; if I make a button in Glade with a text label that has line-break(s) in it, the text on the label ends up being left aligned - and I would like it to be centered.
Longer version:
There is a set_justify() method on <label>s, which would accept "center" as a value - but the button label is a <property> of the <button>, not a fully fledged child widget. Still, looking at the result with the GTKInspector, I can see that a normal label widget gets created inside the button - though I have found no way to attach a class or ID to such an implicit label, or to access it programmatically. For example, builder.get_object("button1").get_property("label") returns a string, and not the actual label object, so there’s nothing for me to call the set_justify() method on. Furthermore, while I can call set_alignment() on the button itself, this only changes the alignment of the label bounding box as a whole, not the lines of text within it. I have spent hours looking for a solution and have come up short - so I have to ask for help!
Edit: As far as I have been able to determine, there is no way to achieve this with CSS alone.
Yeah. I’d like to avoid doing that if at all possible; easier to keep track of the layout if it’s all in the XML. Could I perhaps manually add the label in the XML somehow? I mean, so that it’s a fully fledged label rather than just a <property> of the <button>?
Perfect, that’s exactly what I was after. Probably obvious to anyone with experience, but I only started tinkering with GTK GUIs and Glade yesterday. I did find that \n rendered literally though; I had to use 
 to get the line break to appear.