Can I get recursive child menu_item in menu_bar?



Please help.

I try append new menu_item to menu_bar of already showing.
That function still hasn't been found in menu_* manual of gtk3.
But I can not get recursive grand child menu_item from menu_bar.

Can I get recursive child menu_item in menu_bar?
Must I remember menu_item structure?

Thanks.



Show message:
==
print:30486896 '_File'

(test.exe:23297): GLib-GObject-WARNING **: invalid cast from 'GtkAccelLabel' to 'GtkContainer'

(test.exe:23297): Gtk-CRITICAL **: gtk_container_foreach: assertion 'GTK_IS_CONTAINER (container)' failed
==

Code:
==
void _expv_widget_print_name(GtkWidget *widget, int *data)
{
    if(0 == *data){
        return;
    }
    g_print("print:%d '%s'\n",
            (unsigned int)widget,
            gtk_menu_item_get_label (GTK_MENU_ITEM(widget))
    );
}

void _expv_recurse_proc_child(GtkWidget *widget,
        void (*func)(GtkWidget *widget, int *data), int *data)
{
    GList *list = gtk_container_get_children (GTK_CONTAINER(widget));
    GList *next = list;
    while(NULL != next){
        func(widget, data);
        (*data)++;
        _expv_recurse_proc_child(GTK_WIDGET(next->data), func, data);
        (*data)--;
        next = next->next;
    }
}

==

--
==========
Michinari.Nukazawa

in the project "daisy bell"
https://daisy-bell.booth.pm/
==========



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