-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
darwinkit: 0.5.0-preview prepare tasks #167
Comments
This new branch sounds impressive. Great job making it. I did noticed you use generics in your code. This means the official Go requirements will be at least 1.18 or higher. I will make it a note in the documentation once this branch is live. |
Yes, good point, it will target Go 1.18+ now and that's worth mentioning in release notes. |
I like how you changed the cocoa package's name to appkit. |
If a type begins with an I does it mean that type is a Go interface? |
The action package's Set() method looks very familiar... I like it. I tried the layout example program. When I tried to get the button object thru the sender variable I saw a panic. Is it still not possible? This is what I tried:
|
The action.Wrap() function is a very good idea. I was actually working on the same thing and was in the testing phase when DarwinKit showed up. |
Correct. This is not a common thing to do in Go, usually you would not have an interface type with the same name as a concrete type. However, we need both for every framework type.
The FFI code allowing callbacks and blocks doesn't work with interfaces right now, so the rule is interfaces are only for method arguments. But callbacks need to use concrete types. Try an |
I found an easy fix for this issue. Create another function that does take the NSControl subclass as an argument. This is the updated action.Set() method:
Now I am able to get the button thru the sender argument. |
I'm confused. The code shown uses the same argument type you used in your previous code. If you're actually using |
Where is NSMakeRect()? |
This is a function, which historically we haven't had bindings for. However, I'm looking to get them in this time around. Previously, we had a Go function equivalent but it was just a native Go function that returns a struct. Since I'm hoping to get the actual NSMakeRect generated, I haven't included a Go version, but you can see in the examples there is a version you could use or make yourself (rectOf). |
How does someone help provide bindings for functions and classes to DarwinKit? |
There will be documentation, but I'm still getting the system in place. |
I see a macos folder in DarwinKit. Will there be other folders like watchos, iOS, iPadOS, and tvOS? |
If you don't drive me insane before then. |
There is now a darwinkit branch that represents a major rewrite based on a heavily modified hsiafan/cocoa and a new symbols database I'm using that provides metadata for nearly every class, protocol, method, property, struct, enum, constant, union, macro, alias, and function across all Apple frameworks. This is not integrated yet, but that's the next step.
This issue is to track progress towards cutting a
0.5.0-preview
release based on this branch. This pre-release will bring attention to the major breaking changes of the upcoming0.5.0
release, solicit more feedback while things are in flux, and announce the intention to rename to DarwinKit with0.5.0
.So what are the benefits of all this change? Here are some features of this new version:
Most of this is represented in this branch, but below will track what else needs to be done before
0.5.0-preview
. Otherwise, I'm very interested in getting feedback and learning what questions people will have with this release. Please try this branch out, checking out all the new and ported examples and let me know they work on your platform.TODO
oldgen
and use new symbols databaseThe text was updated successfully, but these errors were encountered: