GNOME Bugzilla – Bug 62466
GtkButton needs way of constructing stock-like buttons
Last modified: 2011-02-04 16:17:01 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.
Fairly important and trivial to do , but need to cut-off API additions.
Part of this should also be "a way to use existing stock icons with new labels", as in bug #95319
This is also important with the new gtk-button-images setting which only works for GtkButtons which use stock items.
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.
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.
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 ?
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)