hide or better delete elements in GtkMenu


In my App I add dynamically Menu-entries.
Adding is no problem, but how can I delete or hide them later?

Here is how I add an item to a menu:

   GtkWidget *menu_items;
   GtkWidget *menu;

   menu_items = gtk_menu_item_new_with_label (name);

   /* GetMainWindow returns a Pointer to my mainwindow */
   menu=lookup_widget (GTK_WIDGET (GetMainWindow()), "sets1_menu");

   gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);

   g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
                            G_CALLBACK (set_action_response),
                            (gpointer) g_strdup (name));

   /* show entry */
   gtk_widget_show (menu_items);

I can hide them with gtk_widget_hide(..), but how can I get the pointer?
Hiding is nice, but delete an element would be perfect.

<>< Andreas Madsack

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]