Re: [Vala] self-less delegates



On Sun, May 25, 2008 at 5:34 PM, Jürg Billeter <j bitron ch> wrote:
Anyways, The new_method function does not take any parameters.
However, in trying to use "delegate" to create this callback, I found
that it always seems to add an argument, gpointer *self.  This makes
some sense for most callbacks, but in this case the callback does not
take any parameters.

Use the `static' modifier when declaring the delegate, this prevents the
generation of the user_data / target_object parameter.


Thanks, that worked perfectly!

I thought I'd tried all combinations of the static keyword, but I
guess I missed that one.  While it does make sense that "static" would
work here, what do you think of the idea that delegates described
outside a class should not have the context argument?

Steve



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