pygobject / pgi-docgen

API Documentation Generator for PyGObject
https://lazka.github.io/pgi-docs/
GNU Lesser General Public License v2.1
127 stars 36 forks source link

GtkMenuPositionFunc documentation missing inout params on the "in" side #92

Closed sjohannes closed 9 years ago

sjohannes commented 9 years ago

GtkMenuPositionFunc has inout params x and y. The Python documentation lists them on the return type but on on the params.

This doesn't seem to affect other inout params that I've checked (e.g. in gtk_widget_destroyed).

lazka commented 9 years ago

Thanks. These were only changed to inout in GTK+ 3.16 (resulting in an API break..). The Python docs are currently build using 3.14 but will get updated once 3.16 enters debian.

I currently use this code in quodlibet to support both versions:

def menu_popup(menu, shell, item, func, *args):
    """Wrapper to fix API break:
    https://git.gnome.org/browse/gtk+/commit/?id=8463d0ee62b4b22fa
    """

    if func is not None:
        def wrap_pos_func(menu, *args):
            return func(menu, args[-1])
    else:
        wrap_pos_func = None

    return menu.popup(shell, item, wrap_pos_func, *args)
sjohannes commented 9 years ago

Interesting, thanks; I'll have to use a similar workaround then.

Perhaps showing the version of the documented packages would help slightly? It wouldn't have helped me specifically (my knowledge of GTK+ 3 versions is nonexistent), but maybe someone else would notice that the Python docs are based on 3.14 and figure that something must have changed in 3.16.

Ideally the GTK+ documentation itself should mention the out→inout change, but I don't know if the GTK+ devs would be up for adding special notes just for bindings.

lazka commented 9 years ago

I've opened #93

Not sure what to do about API breaks...

lazka commented 9 years ago

3.16 is now up (since it entered Debian today)