Closed maxfish closed 4 years ago
I think this is fine personally, when the "screen" resizes, the top level components do. I wonder if there is a better way in kha to know when the container / canvas / window resizes though?
I went straight with JS even if there is a function in the Window class that does exactly that:
public function notifyOnResize(callback: Int->Int->Void): Void;
I just didn't know how to access the Kha window from ScreenImpl.hx 😕
Yeah, the window class looks perfect - do you have any idea how you would access that in a normal, non-haxeui, application?
I'm preparing a PR for Kha since a change is required in the library, notifyOnResize is only implemented for the Kore backend. If that goes through then we can change this repo. If not I'll probably look elsewhere for a working UI :-(
Here is the PR https://github.com/Kode/Kha/pull/1198
This is an attempt to fix issue #41, mimicking the resizeListener from haxeui-HTML5.
It works as expected, but I'm pretty sure I don't know enough about how haxeui-kha (and haxeui in general) deals with all the different targets.