From 1773d815583c0d4bded05c1d89d6fce7b6032e0c Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 27 Sep 2001 00:11:23 +0000 Subject: [PATCH] add demo of passing non-stock label in to gtk_dialog_new_with_buttons 2001-09-26 Havoc Pennington * 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 --- ChangeLog | 14 ++++++++++++++ ChangeLog.pre-2-0 | 14 ++++++++++++++ ChangeLog.pre-2-10 | 14 ++++++++++++++ ChangeLog.pre-2-2 | 14 ++++++++++++++ ChangeLog.pre-2-4 | 14 ++++++++++++++ ChangeLog.pre-2-6 | 14 ++++++++++++++ ChangeLog.pre-2-8 | 14 ++++++++++++++ demos/gtk-demo/dialog.c | 2 ++ gtk/gtkbutton.c | 14 +++++++++++--- gtk/gtktextiter.h | 5 +++++ gtk/gtktextview.c | 2 ++ 11 files changed, 118 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b25e7a5f49..c20a1a53ec 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,17 @@ +2001-09-26 Havoc Pennington + + * 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 + Wed Sep 26 19:48:01 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_valist): Stop being diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c index 92358b973a..5bca888f0b 100644 --- a/demos/gtk-demo/dialog.c +++ b/demos/gtk-demo/dialog.c @@ -46,6 +46,8 @@ interactive_dialog_clicked (GtkButton *button, GTK_DIALOG_MODAL| GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_OK, + "_Non-stock Button", + GTK_RESPONSE_CANCEL, NULL); hbox = gtk_hbox_new (FALSE, 8); diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 5d4a27a7b6..cc49f886ef 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); } /** diff --git a/gtk/gtktextiter.h b/gtk/gtktextiter.h index 72303ea931..8d6096ca9c 100644 --- a/gtk/gtktextiter.h +++ b/gtk/gtktextiter.h @@ -43,6 +43,11 @@ extern "C" { typedef struct _GtkTextBuffer GtkTextBuffer; struct _GtkTextIter { + /* GtkTextIter is an opaque datatype; ignore all these fields. + * Initialize the iter with gtk_text_buffer_get_iter_* + * functions + */ + /*< private >*/ gpointer dummy1; gpointer dummy2; gint dummy3; diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index ed38d1c9c7..d3dfd9d738 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -3776,6 +3776,8 @@ cursor_blinks (GtkTextView *text_view) #ifdef DEBUG_VALIDATION_AND_SCROLLING return FALSE; #endif + if (gtk_debug_flags & GTK_DEBUG_UPDATES) + return FALSE; g_object_get (G_OBJECT (settings), "gtk-cursor-blink", &blink, NULL); return blink;