add CreateAccessible and GetOrCreateAccessible#2515
add CreateAccessible and GetOrCreateAccessible#2515DietmarSchwertberger wants to merge 2 commits intowxWidgets:masterfrom
Conversation
|
@swt2c : How familiar are you with SIP? Probably it would be best to ask on the PyQt/SIP mailing list for support, right? |
|
Hey Dietmar, I'm fairly familiar with sip, give me a little time to look at it... |
|
Thanks for the detailed debugging. :-) After looking at it, I think |
|
Ah, thanks a lot. That seems to work. From the documentation I would never have guessed that... From debugging, the methods like I have pushed the modification. The checks will continue to fail until wxWidgets points to a more recent version, after commit wxWidgets/wxWidgets@bd899c6 Should I leave the status at "Draft" for the time, or switch it already to "Ready for review"? I will now continue to work on wxGrid accessibility support (wxGlade/wxGlade#534 (comment)). That's why I looked into this topic. |
|
This pull request has been mentioned on Discuss wxPython. There might be relevant details there: https://discuss.wxpython.org/t/has-wx-accessible-ever-worked/35454/7 |
|
I just saw this, after I created this PR to update wxWidgets. In that PR, I added the minimal support for accessibility required to compile in non-MSW platforms mimicking for the new methods |
|
Hey @DietmarSchwertberger, the master branch now has moved to v3.2.5 and we also included part of your changes in this PR. The changes for tweaker_tools were not included because they don't compile on GTK and macOS. |
|
Thanks a lot. I modeled the changes in |
|
I have modified and built 4.2.2 on Windows and I think this should do the trick to enable @swt2c : Would you mind adding these lines to |
|
see PR #2618 for the required change to |
|
This pull request has been mentioned on Discuss wxPython. There might be relevant details there: https://discuss.wxpython.org/t/cant-build-wxpython-4-2-2-on-some-suse-distributions/40176/1 |






This PR improves accessibility support on Windows, once
ext/wxwidgetsis updated to a version after January 11.( after commit wxWidgets/wxWidgets@bd899c6 "Add missing documentation of wxWindow accessibility functions" )
This PR adds support for
CreateAccessible, allowing on-demand creation of custom accessibility support.(At the moment, if a widget needs customized support, a
wx.Accessibleinstance needs to be assigned in advance to a widget usingSetAccessible.)The PR is not complete yet.
I'm posting it already, because I need help.
The remaining problem is that
CreateAccessiblein a derived class needs to keep a reference to its return value.E.g. this code will fail with an address exception if
self._acc = ret = MyAcc(self)is replaced withret = MyAcc(self)I tried adding a SIP annotation
/KeepReference/manually tosip/gen/window.sip:This did not help, though. The code that actually keeps the reference is not called.