aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/parser.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-08 14:45:36 -0600
committerTed Gould <ted@gould.cx>2011-03-08 14:45:36 -0600
commitb0b55b00b2460f3430b661e8cbc43e6a07759e66 (patch)
tree846f27b5b6aaf508e5b782e6ba59596007db143c /libdbusmenu-gtk/parser.c
parent1a1e6c4c24276b7d921d729c277e0c2fd7405d40 (diff)
downloadlibdbusmenu-b0b55b00b2460f3430b661e8cbc43e6a07759e66.tar.gz
libdbusmenu-b0b55b00b2460f3430b661e8cbc43e6a07759e66.tar.bz2
libdbusmenu-b0b55b00b2460f3430b661e8cbc43e6a07759e66.zip
Add a callback for child-removed as well
Diffstat (limited to 'libdbusmenu-gtk/parser.c')
-rw-r--r--libdbusmenu-gtk/parser.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index cf2003f..bde460d 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -69,6 +69,9 @@ static void action_notify_cb (GtkAction * action,
static void child_added_cb (GtkContainer * menu,
GtkWidget * widget,
gpointer data);
+static void child_removed_cb (GtkContainer * menu,
+ GtkWidget * widget,
+ gpointer data);
static void theme_changed_cb (GtkIconTheme * theme,
gpointer data);
static void item_activated (DbusmenuMenuitem * item,
@@ -262,6 +265,10 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse)
"child-added",
G_CALLBACK (child_added_cb),
recurse->parent);
+ g_signal_connect (G_OBJECT (widget),
+ "child-removed",
+ G_CALLBACK (child_removed_cb),
+ recurse->parent);
g_object_add_weak_pointer(G_OBJECT (widget), (gpointer*)&pdata->shell);
}
@@ -466,6 +473,10 @@ construct_dbusmenu_for_widget (GtkWidget * widget)
"child-added",
G_CALLBACK (child_added_cb),
mi);
+ g_signal_connect (G_OBJECT (submenu),
+ "child-removed",
+ G_CALLBACK (child_removed_cb),
+ mi);
g_object_add_weak_pointer(G_OBJECT(submenu), (gpointer*)&pdata->shell);
}
@@ -869,6 +880,14 @@ child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data)
parse_menu_structure_helper(widget, &recurse);
}
+/* A child item was added to a menu we're watching. Let's try to integrate it. */
+static void
+child_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data)
+{
+
+
+}
+
static void
theme_changed_cb (GtkIconTheme *theme, gpointer data)
{