From 14520bd75b6edcfe08d8992ca282cfecbed01218 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Mon, 15 May 2017 11:36:42 +0200 Subject: Make test-simple-app really working. --- tests/test-simple-app.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/test-simple-app.c b/tests/test-simple-app.c index 843466d..114d847 100644 --- a/tests/test-simple-app.c +++ b/tests/test-simple-app.c @@ -19,11 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -#include -#include #include -#include #include static GMainLoop * mainloop = NULL; @@ -31,21 +27,24 @@ static GMainLoop * mainloop = NULL; int main (int argc, char ** argv) { - DbusmenuServer * dms = dbusmenu_server_new("/menu"); - DbusmenuMenuitem * dmi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(dmi, "label", "Bob"); - - AppIndicator * ci = APP_INDICATOR(g_object_new(APP_INDICATOR_TYPE, - "id", "test-application", - "status-enum", APP_INDICATOR_STATUS_ACTIVE, - "icon-name", "system-shutdown", - "menu-object", dms, - NULL)); + gtk_init(&argc, &argv); + GtkWidget *menu_item = gtk_menu_item_new_with_label("Test"); + GtkMenu *menu = GTK_MENU(gtk_menu_new()); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item); + gtk_widget_show(menu_item); + + AppIndicator * ci = app_indicator_new("test-application", + "system-shutdown", + APP_INDICATOR_CATEGORY_APPLICATION_STATUS); + app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE); + app_indicator_set_menu(ci, menu); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); g_object_unref(G_OBJECT(ci)); + g_object_unref(G_OBJECT(menu)); + g_object_unref(G_OBJECT(menu_item)); g_debug("Quiting"); return 0; -- cgit v1.2.3