summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1999-02-23 19:42:53 +0000
committerTim Janik <timj@src.gnome.org>1999-02-23 19:42:53 +0000
commit26ffb00362cb61b5a73bc86db64de45ae234ccbe (patch)
tree71dfe043b5c9a929ba6779e2cb086e33af9fb266 /gtk
parente3eedba2f9e1c7b6250b0a83b099b53920514125 (diff)
downloadgtk+-26ffb00362cb61b5a73bc86db64de45ae234ccbe.tar.gz
fix implicit branch creation, we need the *real* parent path for this and
Tue Feb 23 17:52:37 1999 Tim Janik <timj@gtk.org> * gtk/gtkitemfactory.c (gtk_item_factory_create_item): fix implicit branch creation, we need the *real* parent path for this and gtk_item_factory_parse_path() only returns the parent path with "_?" stripped off.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkitemfactory.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c
index 72f5b859d4..027b6314c5 100644
--- a/gtk/gtkitemfactory.c
+++ b/gtk/gtkitemfactory.c
@@ -1024,16 +1024,23 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
if (!parent)
{
GtkItemFactoryEntry pentry;
+ gchar *ppath, *p;
- pentry.path = parent_path;
+ ppath = g_strdup (entry->path);
+ p = strrchr (ppath, '/');
+ g_return_if_fail (p != NULL);
+ *p = 0;
+ pentry.path = ppath;
pentry.accelerator = NULL;
pentry.callback = NULL;
pentry.callback_action = 0;
pentry.item_type = "<Branch>";
gtk_item_factory_create_item (ifactory, &pentry, NULL, 1);
+ g_free (ppath);
parent = gtk_item_factory_get_widget (ifactory, parent_path);
+ g_return_if_fail (parent != NULL);
}
g_free (parent_path);