GNOME Bugzilla – Bug 377642
[Meta] Cannot override all methods in atk
Last modified: 2018-08-17 13:38:45 UTC
Fix to bug #377253 allows Python objects to subclass atk.AccessibleObject to provide accessibility support for custom widgets. Implementing most other atk interfaces (e.g. atk.Action) works fine as the do_* methods are exposed and overrideable. Implementing atk.Value, however, is not possible at present. In fact, subclassing atk.Value results in an immediate segfault at program startup with accessibility enabled. The reason appears to be that atk.overrides is correct for the out parameter on the C interface, but not in a way that accounts for the the Python object itself implementing the value interface. Perhaps mimicking what other classes that support do_* proxies do in their init methods will work here?
This same problem exists for numerous methods on atk.Component, atk.Text, and atk.EditableText. Basically, anywhere a method is needed in atk.overrides to account for out parameters, a __proxy_do_* method must be implemented that allows overriding and accounts for out params.
After closer inspection of the code generator, it appears it is capable of solving most of this problem without manual wrappers. I'll mark related bugs blocking this bug.
pygtk is not under active development anymore and had its last code changes in 2013. Its codebase has been archived: https://gitlab.gnome.org/Archive/pygtk/commits/master PyGObject at https://gitlab.gnome.org/GNOME/pygobject is its successor. See https://pygobject.readthedocs.io/en/latest/guide/porting.html for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent version of PyGObject. Thanks!