aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-11-24 14:51:27 -0600
committerTed Gould <ted@gould.cx>2009-11-24 14:51:27 -0600
commitf5ad2016987b89cb50e50cd785e1f9c2936a7aed (patch)
treed0a1f404afc362606e6a10a09f8e4f6840d75069
parent06ac252b809a6d7ca932a694ff499d7db2bab6e5 (diff)
parentbfb7a29cb4e8de7ac9bd8376ecdedfded0cbcac0 (diff)
downloadlibayatana-indicator-f5ad2016987b89cb50e50cd785e1f9c2936a7aed.tar.gz
libayatana-indicator-f5ad2016987b89cb50e50cd785e1f9c2936a7aed.tar.bz2
libayatana-indicator-f5ad2016987b89cb50e50cd785e1f9c2936a7aed.zip
Adding support for remove.
-rw-r--r--debian/changelog6
-rw-r--r--tools/indicator-loader.c20
2 files changed, 26 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index b1829b6..728b2bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libindicator (0.3.0~dev-0ubuntu1~ppa6~tl2) UNRELEASED; urgency=low
+
+ * Adding support for remove.
+
+ -- Ted Gould <ted@ubuntu.com> Tue, 24 Nov 2009 14:51:09 -0600
+
libindicator (0.3.0~dev-0ubuntu1~ppa6~tl1) karmic; urgency=low
* Adding a new tool to load indicators from the command line.
diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c
index feb0344..4df430e 100644
--- a/tools/indicator-loader.c
+++ b/tools/indicator-loader.c
@@ -2,6 +2,8 @@
#include <gtk/gtk.h>
#include <libindicator/indicator-object.h>
+#define ENTRY_DATA_NAME "indicator-custom-entry-data"
+
static void
entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
{
@@ -26,6 +28,21 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_d
gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem);
gtk_widget_show(menuitem);
+ g_object_set_data(G_OBJECT(menuitem), ENTRY_DATA_NAME, entry);
+
+ return;
+}
+
+static void
+entry_removed_cb (GtkWidget * widget, gpointer userdata)
+{
+ gpointer data = g_object_get_data(G_OBJECT(widget), ENTRY_DATA_NAME);
+
+ if (data != userdata) {
+ return;
+ }
+
+ gtk_widget_destroy(widget);
return;
}
@@ -33,6 +50,9 @@ static void
entry_removed (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
{
g_debug("Signal: Entry Removed");
+
+ gtk_container_foreach(GTK_CONTAINER(user_data), entry_removed_cb, entry);
+
return;
}