summaryrefslogtreecommitdiff
path: root/gtk/gtkitemfactory.c
diff options
context:
space:
mode:
authorGuillaume Laurent <glaurent@src.gnome.org>1998-11-07 00:33:22 +0000
committerGuillaume Laurent <glaurent@src.gnome.org>1998-11-07 00:33:22 +0000
commit75fff482b91691ca465d8f343ce018955fb212fe (patch)
tree889e1a7fab04b36c01b91ec31055031955df04f3 /gtk/gtkitemfactory.c
parentb0f8915fe79a62bd12b02e74ca2ffee9555a94b5 (diff)
downloadgdk-pixbuf-75fff482b91691ca465d8f343ce018955fb212fe.tar.gz
Added warning about callback on <Branch> items
Diffstat (limited to 'gtk/gtkitemfactory.c')
-rw-r--r--gtk/gtkitemfactory.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c
index 7f9b6a5cf..8639cb46a 100644
--- a/gtk/gtkitemfactory.c
+++ b/gtk/gtkitemfactory.c
@@ -1087,6 +1087,10 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
{
GtkAccelGroup *menu_group;
+ if (entry->callback)
+ g_warning ("gtk_item_factory_create_item(): Can't specify a callback on a branch: \"%s\"",
+ entry->path);
+
menu_group = gtk_accel_group_new ();
if (type_id == quark_type_last_branch)
@@ -1103,7 +1107,9 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
gtk_item_factory_add_item (ifactory,
path, entry->accelerator,
- entry->callback, entry->callback_action, callback_data,
+ (type_id == quark_type_branch ||
+ type_id == quark_type_last_branch) ? NULL : entry->callback,
+ entry->callback_action, callback_data,
callback_type,
item_type_path,
widget);