Back to index

libindicate  12.10.0
test-menu-client.c
Go to the documentation of this file.
00001 
00002 #include <glib.h>
00003 #include "libindicate/indicator.h"
00004 
00005 static gboolean passed = TRUE;
00006 static GMainLoop * mainloop = NULL;
00007 
00008 static gboolean
00009 done_timeout_cb (gpointer data)
00010 {
00011        g_debug("All done.");
00012        g_main_loop_quit(mainloop);
00013        return FALSE;
00014 }
00015 
00016 int
00017 main (int argc, char * argv)
00018 {
00019        g_type_init();
00020 
00021        g_debug("Starting client");
00022        IndicateIndicator * indicator = indicate_indicator_new();
00023 
00024        DbusmenuServer * server = dbusmenu_server_new("/org/test/menu");
00025        indicate_server_set_menu(indicate_indicator_get_server(indicator), server);
00026 
00027        g_debug("Show indicator");
00028        indicate_indicator_show(indicator);
00029 
00030        g_timeout_add_seconds(2, done_timeout_cb, indicator);
00031 
00032        mainloop = g_main_loop_new(NULL, FALSE);
00033        g_main_loop_run(mainloop);
00034 
00035        return !passed;
00036 }