[gtk+/gtk-3-8] gtkdialog - more informative warning when ordering unexisting response_id (cherry picked from commit
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] gtkdialog - more informative warning when ordering unexisting response_id (cherry picked from commit
- Date: Sun, 21 Jul 2013 12:53:26 +0000 (UTC)
commit 81f06e17494755d0f85b15856fb895702d448bbf
Author: Jehan <jehan girinstud io>
Date: Wed Jul 17 19:05:21 2013 +0900
gtkdialog - more informative warning when ordering unexisting response_id
(cherry picked from commit 0e4d9b7793c16fd98b396ffe6b8db48b8e09f1d2)
gtk/gtkdialog.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index b88ca5f..70e2fe1 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -1254,7 +1254,11 @@ gtk_dialog_set_alternative_button_order_valist (GtkDialog *dialog,
{
/* reorder child with response_id to position */
child = dialog_find_button (dialog, response_id);
- gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
+ if (child != NULL)
+ gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
+ else
+ g_warning ("%s : no child button with response id %d.", G_STRFUNC,
+ response_id);
response_id = va_arg (args, gint);
position++;
@@ -1365,7 +1369,11 @@ gtk_dialog_set_alternative_button_order_from_array (GtkDialog *dialog,
{
/* reorder child with response_id to position */
child = dialog_find_button (dialog, new_order[position]);
- gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
+ if (child != NULL)
+ gtk_box_reorder_child (GTK_BOX (priv->action_area), child, position);
+ else
+ g_warning ("%s : no child button with response id %d.", G_STRFUNC,
+ new_order[position]);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]