New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add CreateAccessible and GetOrCreateAccessible #2515
base: master
Are you sure you want to change the base?
add CreateAccessible and GetOrCreateAccessible #2515
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 |
This PR improves accessibility support on Windows, once
ext/wxwidgets
is 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.Accessible
instance 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
CreateAccessible
in 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.