Re: user_data for callbacks



2012/9/25 Daniel Drake <dsd laptop org>:
> Hi,
>
> Just checking the introspection of g_volume_mount():
>
> /**
>  * g_volume_mount:
>  * @volume: a #GVolume.
>  * @flags: flags affecting the operation
>  * @mount_operation: (allow-none): a #GMountOperation or %NULL to
> avoid user interaction.
>  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
>  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
>  * @user_data: user data that gets passed to @callback
>  *
>  * Mounts a volume. This is an asynchronous operation, and is
>  * finished by calling g_volume_mount_finish() with the @volume
>  * and #GAsyncResult returned in the @callback.
>  *
>  * Virtual: mount_fn
>  **/
>
> The user_data parameter above doesn't have a (closure) annotation, but
> looking at the gir file, it doesn't seem necessary: the callback
> parameter has closure=4 already set.
>
> Python wants me to pass 5 arguments, i.e.
> volume.mount(flags, mount_op, cancellable, callback, user_data)

I saw the same issue in Gtk.Clipboard.request_text, I had to feed it
with user_data=None in other to make it work.

See at the bottom of this diff:
http://git.sugarlabs.org/sugar/mainline/commit/e92baeeba033ae2fc4276ea088d6036e284dfd56

-- 
.. manuq ..


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