Back to index

libappindicator  12.10.0
Functions | Variables
test-simple-app.c File Reference
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <glib.h>
#include <libdbusmenu-glib/server.h>
#include <app-indicator.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Variables

static GMainLoop * mainloop = NULL

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 32 of file test-simple-app.c.

{
       g_type_init();

       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));

       mainloop = g_main_loop_new(NULL, FALSE);
       g_main_loop_run(mainloop);

       g_object_unref(G_OBJECT(ci));
       g_debug("Quiting");

       return 0;
}

Variable Documentation

GMainLoop* mainloop = NULL [static]

Definition at line 29 of file test-simple-app.c.