aboutsummaryrefslogtreecommitdiff
path: root/tests/test-simple-app.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-simple-app.c')
-rw-r--r--tests/test-simple-app.c27
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;