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 409380 - add gtk_label_new_markup() and gtk_label_set_label_printf() proposal
add gtk_label_new_markup() and gtk_label_set_label_printf() proposal
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkLabel
2.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-02-18 19:49 UTC by Olexiy Avramchenko
Modified: 2008-10-02 05:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.85 KB, patch)
2007-02-18 19:49 UTC, Olexiy Avramchenko
rejected Details | Review

Description Olexiy Avramchenko 2007-02-18 19:49:31 UTC
Hi,

I keep these (or similar) two helpers for GtkLabel with every my project for more than two years, so I decided to propose them into the mainline.

1. gtk_label_new_with_markup() - constructor that sets "use-markup" to TRUE and thus saves following call to gtk_label_set_markup() or gtk_label_set_use_markup() further in code.

2. gtk_label_set_label_printf() - helper to set the content (text, markup or whatever) of the label in printf-like way. Useful in many cases.

Olexiy
Comment 1 Olexiy Avramchenko 2007-02-18 19:49:58 UTC
Created attachment 82844 [details] [review]
proposed patch
Comment 2 Björn Lindqvist 2008-09-12 16:57:01 UTC
I vote -1 on both. gtk_label_set_label_printf() is C-specific and not useful in other languages and there are already to many different label-text setters in GtkLabel, imho. gtk_label_new_with_markup() is more useful, but saves only one line gtk_label_set_use_markup (label, TRUE); which is not worth it.
Comment 3 John Boncek 2008-09-12 19:10:49 UTC
Agree -- no on both, for the cogent reasons stated by Björn.  For gtk_label_new_with_markup, adding a different constructor to vary one property is rarely if ever a good idea.
Comment 4 Matthias Clasen 2008-10-02 05:20:24 UTC
Agreed. No need for more label constructors