diff options
author | Ted Gould <ted@gould.cx> | 2009-11-24 10:13:44 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-11-24 10:13:44 -0600 |
commit | cd27c1b5e235076bed739375900e986d89d28e2b (patch) | |
tree | 8ea7ff304af8b63e93237bf7786a14f399d06dc6 /tools/indicator-loader.c | |
parent | a9b6d6fe3b408ff0827eb123a4c5bf62ae42f141 (diff) | |
download | libayatana-indicator-cd27c1b5e235076bed739375900e986d89d28e2b.tar.gz libayatana-indicator-cd27c1b5e235076bed739375900e986d89d28e2b.tar.bz2 libayatana-indicator-cd27c1b5e235076bed739375900e986d89d28e2b.zip |
Grabbing the entry added function as well, didn't realize how much it did :)
Diffstat (limited to 'tools/indicator-loader.c')
-rw-r--r-- | tools/indicator-loader.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c index 88cf537..9857647 100644 --- a/tools/indicator-loader.c +++ b/tools/indicator-loader.c @@ -6,6 +6,26 @@ static void entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data) { g_debug("Signal: Entry Added"); + + GtkWidget * menuitem = gtk_menu_item_new(); + GtkWidget * hbox = gtk_hbox_new(FALSE, 3); + + if (entry->image != NULL) { + gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->image), FALSE, FALSE, 0); + } + if (entry->label != NULL) { + gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(entry->label), FALSE, FALSE, 0); + } + gtk_container_add(GTK_CONTAINER(menuitem), hbox); + gtk_widget_show(hbox); + + if (entry->menu != NULL) { + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(entry->menu)); + } + + gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem); + gtk_widget_show(menuitem); + return; } |