Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get a menu to show in a custom application written in C. I create the GtkMenu, populate it with GtkMenuItem(s) and add it to the indicator, which shows up in the indicator list, but the menu doesn't. I feel kinda silly asking this since I'm sure I'm just overlooking something but I'll use as an excuse the fact that I'm tired since it's kinda late here. Thanks in advance for any help.

int main(int argc, char *argv[])
    AppIndicator *indicator;
    GtkWidget *indicator_menu;
    GtkWidget *quitMenuItem;

    gtk_init(&argc, &argv);

    indicator_menu = gtk_menu_new();

    quitMenuItem = gtk_menu_item_new_with_label("Exit");
    g_signal_connect(G_OBJECT(quitMenuItem), "activate",
                                           G_CALLBACK(gtk_main_quit), NULL);

    gtk_menu_append(indicator_menu, gtk_menu_item_new_with_label("entry1"));
    gtk_menu_append(indicator_menu, gtk_menu_item_new_with_label("entry2"));
    gtk_menu_append(indicator_menu, gtk_separator_menu_item_new());
    gtk_menu_append(indicator_menu, quitMenuItem);

    indicator = app_indicator_new("test-client", "user-offline", 

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



    return 0;
share|improve this question
up vote 0 down vote accepted

You should call gtk_widget_show_all(indicator_menu) (at least I guess that's the way doing it in C, I'm using Python).

share|improve this answer
Thanks for the quick reply...I tried using gtk_widget_show (not gtk_widget_show_all) – kicsyromy Jun 15 '11 at 21:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.