diff options
author | Dmitry Shachnev <mitya57@ubuntu.com> | 2017-05-15 11:36:42 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-05-15 11:36:42 +0200 |
commit | 14520bd75b6edcfe08d8992ca282cfecbed01218 (patch) | |
tree | 9b4dcf7c28c49bb7c007c8007747eab7fa1c043d /tests | |
parent | b0a3d75a8dea5d7e743061d9323406edb72bf1fd (diff) | |
download | libayatana-appindicator-14520bd75b6edcfe08d8992ca282cfecbed01218.tar.gz libayatana-appindicator-14520bd75b6edcfe08d8992ca282cfecbed01218.tar.bz2 libayatana-appindicator-14520bd75b6edcfe08d8992ca282cfecbed01218.zip |
Make test-simple-app really working.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-simple-app.c | 27 |
1 files 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 <http://www.gnu.org/licenses/>. */ - -#include <dbus/dbus-glib.h> -#include <dbus/dbus-glib-lowlevel.h> #include <glib.h> -#include <libdbusmenu-glib/server.h> #include <app-indicator.h> 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; |