Hi,
في خ، 04-03-2010 عند 10:39 -0500 ، كتب Arley Consuegra Rosello:
> Hello, the signal 'activate' from MenuItem don't expect any argument,
> this say
> http://valadoc.org/gtk+-2.0/Gtk.MenuItem.activate.html
>
> but in the doc of Gtk apear "GtkMenuItem *menuitem, gpointer user_data"
> like argument.
[...]
> It, is a bug, a documentation error or my error.
When the signal takes n arguments, the handler takes n+2 : the instance
that emitted the signal, the n parameters passed to the signal, and a
pointer for any data that the user wants to pass to the handler. In
Vala, it takes n+1 and the user data is set by Vala (for example it's
the instance in case of a method), so you don't need to pass this.
So for your example, the signal handler should be declared as:
public void some_thing(Gtk.MenuItem sender)
I don't see why your version can cause a segfault, but this is more
correct (and shouldn't crash unless you're doing something wrong
elsewhere).
HTH,
Abderrahim
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list