I think I would often want to call something like https://github.com/phronmophobic/clobber/blob/0ac3fd9242f1c9b52689d1a9b5d67a4419a38153/src/com/phronemophobic/clobber/modes/clojure/ui.clj#L109-L121 on every window resize.
What's the way to do that in membrane? Since as far as I can tell, there's no event type for window size state, and since there's no event type for it (to use with e.g. ui/on), how do we initially create an intent for it?
(I do see you can access the window height in :membrane.component/context but I don' think that fully addresses how to do it "the membrane way")
I do think this is an area where membrane doesn't currently provide an easy option, but it should. I'm still thinking about what membrane should provide as a best practice, but there are a few workarounds that shouldn't be too bad
You can see what easel does here: https://github.com/phronmophobic/easel/blob/d30f495cba48cbb1e8dda2cae722a246163394d4/src/com/phronemophobic/easel.clj#L1056
Ah, nice! that should get me there, thanks
It's key to make sure to call (skia/-reshape window window-handle width height) in the reshape handler or the window might act weird.
I would like to provide a more generic solution built in. Easel has a thing where resize is like an event similar to your description. I've found it pretty convenient.
Same goes for mounting/unmounting. Although, mounting and unmounting are usually abused in most UI application, there are still some use cases for them in membrane.
For both of them, I would like to try to avoid walking the whole UI tree too often.
Nice yeah mounting/unmounting did seem related too. Glad you're taking your time with this stuff! The easel stuff should be more than enough for me for now
I wrote some initial ideas on mounting/unmounting at https://phronmophobic.github.io/membrane/membrane-topics.html#Effects-on-Mounting-or-Unmounting. I still think that approach is more of a workaround than a best practice.
It kinda stink to be in beta for so long, but I am trying to work towards an eventual 1.0.