summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-09-27 00:11:23 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-09-27 00:11:23 +0000
commit1773d815583c0d4bded05c1d89d6fce7b6032e0c (patch)
tree4c8ae7d83a7aa9cb9e34e300f204ef957ae9d427 /gtk/gtkbutton.c
parent4b6bc02f66ee3e9def305a3c1c77a3fec1b37b45 (diff)
downloadgdk-pixbuf-1773d815583c0d4bded05c1d89d6fce7b6032e0c.tar.gz
add demo of passing non-stock label in to gtk_dialog_new_with_buttons
2001-09-26 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/dialog.c (interactive_dialog_clicked): add demo of passing non-stock label in to gtk_dialog_new_with_buttons * gtk/gtktextview.c (cursor_blinks): disable cursor blink when debugging updates * gtk/gtktextiter.h: comment about how GtkTextIter struct contents are private * gtk/gtkbutton.c (gtk_button_new_from_stock): if stock ID doesn't exist, fall back to mnemonic label, not plain label, bug #61184
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 5d4a27a7b..cc49f886e 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -465,16 +465,24 @@ gtk_button_new_with_label (const gchar *label)
/**
* gtk_button_new_from_stock:
* @stock_id: the name of the stock item
- * @returns: a new #GtkButton
*
* Creates a new #GtkButton containing the image and text from a stock item.
* Some stock ids have preprocessor macros like #GTK_STOCK_OK and
* #GTK_STOCK_APPLY.
+ *
+ * If @stock_id is unknown, then it will be treated as a mnemonic
+ * label (as for gtk_button_new_with_mnemonic()).
+ *
+ * Returns: a new #GtkButton
**/
GtkWidget*
-gtk_button_new_from_stock (const gchar *stock_id)
+gtk_button_new_from_stock (const gchar *stock_id)
{
- return g_object_new (GTK_TYPE_BUTTON, "label", stock_id, "use_stock", TRUE, NULL);
+ return g_object_new (GTK_TYPE_BUTTON,
+ "label", stock_id,
+ "use_stock", TRUE,
+ "use_underline", TRUE,
+ NULL);
}
/**