Skip to content

Instantly share code, notes, and snippets.

@davidboy
Created June 24, 2011 17:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidboy/1045233 to your computer and use it in GitHub Desktop.
Save davidboy/1045233 to your computer and use it in GitHub Desktop.
Awsum C niceness!
#include <gtk/gtk.h>
#include <libappindicator/app-indicator.h>
int main (int argc, char **argv) {
gtk_init(&argc, &argv);
GtkWidget *menu;
GtkWidget *menu_item;
AppIndicator *indicator;
menu = gtk_menu_new();
menu_item = gtk_menu_item_new_with_label("Hello world!");
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
indicator = app_indicator_new ("example-simple-client",
"indicator-messages",
APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE);
app_indicator_set_attention_icon (indicator, "indicator-messages-new");
app_indicator_set_menu (indicator, GTK_MENU (menu));
gtk_widget_show_all(menu);
gtk_main();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment