After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631538 - Wrong parameters for gtk_tree_view_column_set_cell_data_func
Wrong parameters for gtk_tree_view_column_set_cell_data_func
Status: RESOLVED NOTABUG
Product: pygobject
Classification: Bindings
Component: introspection
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-06 17:23 UTC by Sebastian Pölsterl
Modified: 2010-10-25 16:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample code (256 bytes, text/x-python)
2010-10-06 17:23 UTC, Sebastian Pölsterl
Details

Description Sebastian Pölsterl 2010-10-06 17:23:23 UTC
Created attachment 171834 [details]
Sample code

Previously, you could call set_cell_data_func with two arguments, a CellRenderer and a Callback, now I get:

TypeError: set_cell_data_func() takes exactly 4 argument(s) (3 given)

Looking at the C API of this function I thought the 3rd argument might be function data, but this gives:

TypeError: argument 3: Must be callable, not NoneType
Comment 1 johnp 2010-10-06 19:47:17 UTC
Example works for me.  Might be an issue with the annotations.  Are you linking against Gtk 2.0 or 3.0?  Note we are only really supporting 3.0. 

As for needing to supply the user data, it needs to be marked as optional in Gtk.  I'll look into doing that.
Comment 2 Sebastian Pölsterl 2010-10-06 21:32:18 UTC
That's with gtk 2.22.0. The idea was to port to gobject-introspection first, and then to gtk 3.0, but now I guess I have to do both simultaneously.
Comment 3 johnp 2010-10-07 16:04:49 UTC
Ok, there is no way to specify optional parameters (well there is DEFAULT but it isn't implemented yet).  You will have to supply a user_data parameter. Overrides that fix this will not be accepted because it really needs to be fixed in introspection itself.
Comment 4 Sebastian Pölsterl 2010-10-07 17:20:32 UTC
Default parameters would be nice to have. Especially, the pack_* functions used to have default parameters and keyword arguments, but I guess the latter is a different matter.