diff options
author | Ted Gould <ted@gould.cx> | 2009-12-04 09:31:28 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-12-04 09:31:28 -0600 |
commit | 17478a95926724528515cf1d6aadd7730cceb7b0 (patch) | |
tree | 227ada7b7c7fec3c4016546eb6d52332cabd39f8 /example | |
parent | 92a3e89c7690bda61d1548fb5c21b056be078192 (diff) | |
parent | 7406617f441d1377aee6beebe3498c1e37fec57d (diff) | |
download | ayatana-indicator-application-17478a95926724528515cf1d6aadd7730cceb7b0.tar.gz ayatana-indicator-application-17478a95926724528515cf1d6aadd7730cceb7b0.tar.bz2 ayatana-indicator-application-17478a95926724528515cf1d6aadd7730cceb7b0.zip |
Adding GTK Menu support to libappindicator and removing dbusmenu support.
Diffstat (limited to 'example')
-rw-r--r-- | example/simple-client.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/example/simple-client.c b/example/simple-client.c index 80d6d9c..ab2e24d 100644 --- a/example/simple-client.c +++ b/example/simple-client.c @@ -29,31 +29,32 @@ GMainLoop * mainloop = NULL; int main (int argc, char ** argv) { - g_type_init(); + GtkWidget *menu = NULL; + AppIndicator *ci = NULL; - AppIndicator * ci = APP_INDICATOR(g_object_new(APP_INDICATOR_TYPE, NULL)); - g_assert(ci != NULL); + gtk_init (&argc, &argv); - app_indicator_set_id(ci, "example-simple-client"); - app_indicator_set_category(ci, APP_INDICATOR_CATEGORY_APPLICATION_STATUS); - app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE); - app_indicator_set_icon(ci, "indicator-messages"); - app_indicator_set_attention_icon(ci, "indicator-messages-new"); + ci = app_indicator_new ("example-simple-client", + "indicator-messages", + APP_INDICATOR_CATEGORY_APPLICATION_STATUS); + + g_assert (IS_APP_INDICATOR (ci)); + g_assert (G_IS_OBJECT (ci)); - DbusmenuMenuitem * root = dbusmenu_menuitem_new(); + app_indicator_set_status (ci, APP_INDICATOR_STATUS_ACTIVE); + app_indicator_set_attention_icon(ci, "indicator-messages-new"); - DbusmenuMenuitem * item = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Item 1"); - dbusmenu_menuitem_child_append(root, item); + menu = gtk_menu_new (); + GtkWidget *item = gtk_menu_item_new_with_label ("1"); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - item = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Item 2"); - dbusmenu_menuitem_child_append(root, item); + item = gtk_menu_item_new_with_label ("2"); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - DbusmenuServer * menuservice = dbusmenu_server_new ("/need/a/menu/path"); - dbusmenu_server_set_root(menuservice, root); + item = gtk_menu_item_new_with_label ("3"); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - app_indicator_set_menu(ci, menuservice); + app_indicator_set_menu (ci, GTK_MENU (menu)); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); |