-
-
Notifications
You must be signed in to change notification settings - Fork 77
Top-level Window type in DSL #475
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
base: master
Are you sure you want to change the base?
Conversation
Really nice work! A few things:
Looking forward to merging this. Think it's really useful 👍 |
We could adapt the component system a bit so we could have a could look like this: WindowComponent.create(fun ctx ->
ctx.attrs [
Window.title $"Hello {state.Name}!"
Window.icon icon
Window.sizeToContent SizeToContent.WidthAndHeight
]
TextBlock.create [
TextBlock.text "Hello"
]
) This would make the @brianberns what do you think? |
Thanks. Glad you like it! I agree that we might want to get rid of HostWindow eventually, but I didn't want to go that far in my first attempt. Having a window component is probably a good idea but is an area I haven't explored yet. We also have to consider backwards compatibility for existing apps. The patcher change I made is ugly because I didn't want to break existing code. This is another part of the architecture that I'm still learning, so I will defer to you on the best way to integrate. I'd be happy to rename the example app. Should we call it something like "TopLevelWindow"? It's just a tiny app I made for testing purposes, so we could also replace it with something better, or just upgrade the other examples to use Window instead of having a new example at all. |
We definitely need to keep the existing implementation so we don't break existing code (that's always the top priority). But we make it simpler to write new apps that now don't need to use the HostWindow (but still can).
We might get away with close to zero changes to the patcher from what I've seen now.
We can defer that. Maybe we can integrate the sample in an existing sample application once we solve the remaining issues. |
This pull request adds Window and KeyBinding types to the DSL. Example: