GtkMenuItem in Glade translated to GtkAction with gtk-builder-convert



Hi.
I am making a simple Menu in glade and a submenu which will be
populated by code, i cant get it to work.
Glade says that the item is an GtkMenuItem, but after executing the next lines:

        menu = gtk_menu_new();
        widget = GTK_WIDGET (gtk_builder_get_object (builder, "menumodos"));
        gtk_menu_item_set_submenu( GTK_MENU_ITEM(widget) , menu );

It print the next errors:

(Wattmeter:16481): GLib-GObject-WARNING **: invalid cast from
`GtkAction' to `GtkWidget'

(Wattmeter:16481): GLib-GObject-WARNING **: invalid cast from
`GtkAction' to `GtkMenuItem'

(Wattmeter:16481): Gtk-CRITICAL **: gtk_menu_item_set_submenu:
assertion `GTK_IS_MENU_ITEM (menu_item)' failed


I convert the file with this:

gtk-builder-convert interface.glade interface.xml




Could this be a bug?
If not, how can i build a menu with code and attach it to a menu in Glade?

Cheers.
Diego


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