capy-ui / capy

💻Build one codebase and get native UI on Windows, Linux and Web
https://capy-ui.org
Mozilla Public License 2.0
1.6k stars 60 forks source link

fix: Fixes macos build #91

Closed OlshaMB closed 1 month ago

OlshaMB commented 1 month ago

Small fixes to make macos build again

OlshaMB commented 1 month ago

@zenith391 Hello, I am trying to build better support for macos. But I am a bit stuck trying understand EventUserData, as understand it stores handlers to events on the peer object. If so, then I don't how to put them onto objc.Object.

zenith391 commented 1 month ago

@zenith391 Hello, I am trying to build better support for macos. But I am a bit stuck trying understand EventUserData, as understand it stores handlers to events on the peer object. If so, then I don't how to put them onto objc.Object.

Yes that's what it does. But objc.Object is just a reference to any kind of Objective-C object (it could be to a string, a dictionary, etc.). So for EventUserData you should look into the base class of AppKit widgets: NSView, which is the superclass of things like NSButton, NSTextView and so on.