GNOME Bugzilla – Bug 542953
[gtk+] gtk_menu_shell_append.child wrongly set to MenuItem
Last modified: 2008-07-17 09:10:22 UTC
In the vapi of gtk+-2.0 the gtk_menu_shell_append.child is set to MenuItem. But in the real C headers this is a Gtk.Widget. If you now compile you get some gcc warnings about the argument from incompatible pointer type. Program to demonstrate this: using Gtk; using GLib; public class menu_ex : Gtk.Menu { construct { append (new MenuItem.with_label ("hello")); } } public static int main (string[] args) { return 1; }
Created attachment 114534 [details] [review] set the gtk_menu_shell_append.child to Widget
I don't think that is the best fix for this bug. The parameter does have to be a MenuItem, so it really should be a MenuItem in the Vala bindings. It is just a GtkWidget* for the CCode generation. So it would be better to have metadata/attribute/codegen support so that the code generator adds the GTK_WIDGET cast.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 543073 ***