[Vala] Gtk.TreeSelection bindings



I'm having some problems with the set_select_function method and its delegate, Gtk.TreeSelectionFunc.  A user data void * is available to pass a target pointer, but it's not being used.  The target pointer is being inserted anyway by valac, causing compilation errors.

I hand-edited 0.6.1's gtk+-2.0.vapi to get something working.  It looks like this is more in the ballpark:

4407c4407,4408
<         public void set_select_function (Gtk.TreeSelectionFunc func, void* data, Gtk.DestroyNotify destroy);
---
>         [CCode (delegate_target_pos=1.1)]
>         public void set_select_function (Gtk.TreeSelectionFunc func, Gtk.DestroyNotify? destroy);
6725c6726
<     [CCode (cheader_filename = "gtk/gtk.h")]
---
>     [CCode (cheader_filename = "gtk/gtk.h", delegate_target_pos=3.1)]

This also handles passing null for the destroy function, which is valid, although with the data pointer being used for the target, I'm not sure its necessary.

-- Jim Nelson
Yorba



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