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 62466 - GtkButton needs way of constructing stock-like buttons
GtkButton needs way of constructing stock-like buttons
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-10-16 19:08 UTC by Jonathan Blandford
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a patch (6.12 KB, patch)
2004-11-15 20:11 UTC, Matthias Clasen
none Details | Review

Description Jonathan Blandford 2001-10-16 19:08:12 UTC
Currently, if the user wants to make a button look like a stock button,
they either need to know exactly how stock buttons are created, or register
their own stock type.  Exporting gtk_button_construct_child's functionality
would be nice.
Comment 1 Owen Taylor 2001-10-18 15:45:30 UTC
Fairly important and trivial to do , but need to cut-off API 
additions.
Comment 2 Havoc Pennington 2002-10-09 18:11:53 UTC
Part of this should also be "a way to use existing stock icons with
new labels", as in bug #95319
Comment 3 Anders Carlsson 2004-02-25 00:16:44 UTC
This is also important with the new gtk-button-images setting which
only works for GtkButtons which use stock items.
Comment 4 Matthias Clasen 2004-11-15 20:11:15 UTC
Created attachment 33818 [details] [review]
a patch

Here is a patch which adds a GtkButton::image property.
When GtkButton::use-stock is set, the explicit image is preferred over
the stock image, but the stock text is still used.
Comment 5 Jonathan Blandford 2004-11-15 20:16:25 UTC
That's not quite what I wanted, though I guess it's a step in the right
direction.  I want to set the text/image of a button to be in the style of a
stock button, but have custom text/images.
Comment 6 Matthias Clasen 2004-11-15 20:24:09 UTC
well, you can do

button = gtk_button_new_from_stock (stock_bla);
gtk_button_set_image (button, custom_image);

to get a button with custom image and stock text

and

button = gtk_button_new_with_label (custom_label);
button = gtk_button_set_image (button, gtk_image_new_from_stock (stock_bla));

to get a button with stock image and custom text

and they will both be in the same "style" as a stock button.

Or am I missing something ?
Comment 7 Matthias Clasen 2004-11-15 20:56:42 UTC
2004-11-15  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkbutton.[hc]: Add a GtkButton::image property with setter 
	and getter, which allows to construct stock-like buttons with 
	custom images and/or text.  (#62466, Jonathan Blandford, patch by
	Matthias Clasen)