Skip to content

feat: Add window-based constructor to macOS subclassing adapter #253

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

Merged
merged 2 commits into from
Jun 23, 2023

Conversation

mwcampbell
Copy link
Contributor

This easily solves the issue we're having with #250, where we'd otherwise have to either write a little Objective-C or do some low-level stuff with the ObjC runtime from C code to make the SDL example compile on macOS. It might also help some Rust users, which is why I implemented the alternate constructor in the platform adapter itself.

Copy link
Member

@DataTriny DataTriny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we won't need a similar function on the regular Adapter?

@mwcampbell
Copy link
Contributor Author

I've chosen not to add a similar function on the regular adapter because the assumption is that if a user is using the regular (non-subclassing) adapter, then they're implementing their own NSView subclass already, which means either they're writing in Objective-C, or they already have a way of working with the ObjC runtime, such as the objc2 crate. So they already have a way of directly providing the view, probably because they instantiated it from their own class.

@mwcampbell mwcampbell merged commit 022ef04 into main Jun 23, 2023
@mwcampbell mwcampbell deleted the macos-subclassing-adapter-for-window branch June 23, 2023 19:06
@mwcampbell mwcampbell mentioned this pull request Jun 23, 2023
lunixbochs pushed a commit to talonvoice/accesskit that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants