After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 591821 - GtkRadioButton does not support <attributes> tag
GtkRadioButton does not support <attributes> tag
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
2.19.x
Other All
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks: 99759 102382 658657
 
 
Reported: 2009-08-14 16:30 UTC by Claude Paroz
Modified: 2014-09-27 04:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Claude Paroz 2009-08-14 16:30:37 UTC
In order to remove markup in translatable strings in GTKBuilder files (see bug #97061), we're using the new attributes tag introduced in GTK+ 2.16. Unfortunately, GTKRadioButton does not seem to support these attributes, so we have to let the markup inside the button label.
Comment 1 Tristan Van Berkom 2009-08-14 16:51:16 UTC
Interesting, it had not occurred to me that exposing
the "attributes" of the underlying label was not enough.

i.e. you can still embed your GtkLabel and set markup on
the label, but then you dont get to leverage the image-position
property and image property (and you also end up with customized
hierarchies that dont always match the guesswork done by themes).

I think the best solution all around would be to expose
the GtkButton's label as a property just like the image widget, 
allowing the button to control the alignment/box and handle 
image-position properly, and also allowing full customization of the label.

Comment 2 Khaled Hosny 2011-01-12 12:13:19 UTC
Any updates on this?
Comment 3 Tristan Van Berkom 2011-01-12 12:33:27 UTC
Nothing changed here, and since by now the GtkButton provides
the "label-widget" property I dont think it's reasonable to add
more api where it's unneeded.

I.e., you can just as well setup a GtkLabel with your attributes
and make it the "label widget" of the button (while adding
custom contents to the button directly is error prone, because
the custom contents would not comply to desktop "show-images"
setting... as well as it's not obvious to get the GtkButton
hierarchy right, i.e. button { alignment { hbox { image, label } } }).

My opinion, no reason to bloat the button api with this.

GtkEntry would be an interesting case to implement <attributes> on though...
Comment 4 Tristan Van Berkom 2011-01-12 12:37:15 UTC
Ugh, it seems I was wrong, GtkButton doesnt expose a 'label-widget'
property, only the 'image' property is currently exposed.

Let's rephrase then, I think it would cost less code and cover
more ground to just add the 'label-widget' property to GtkButton
rather than to replicate the attributes parsing there.
Comment 5 Matthias Clasen 2012-09-06 09:52:48 UTC
I don't like adding random extra properties for children, tbh.
It only adds confusion.
Comment 6 Tristan Van Berkom 2012-09-06 12:09:26 UTC
Perhaps a "label" <internal-child> supported at the GtkButton level would be
most appropriate to cover this sort of thing.

The odd part of that is; the label widget is not always valid; its only
valid if the GtkButton is actually setup to create the label.

Of course that could be documented, and Glade could optionally expose
the internal label for configuration *if* it's setup to create a label.
Comment 7 Matthias Clasen 2014-09-27 04:26:14 UTC
I think it is better to explicitly create a label when one is needed.