Closed as3boyan closed 9 years ago
I can provide generated code if that helps.
That class is not even an extern and is too hacky not to break. Haxe 3.2 has js-flatten
enabled by default, so it generates nodejs_webkit_$ui
which then fails to be assigned to because of raw js injection that works with nodejs.webkit.$ui
.
The following code works good and is the preferred way:
@:jsRequire("nw.gui")
extern class UI {}
Thanks making class an extern with jsRequire
works. But how to deal with nodejs.webkit.Window = nodejs_webkit_UI.Window;
where nodejs
is still not defined?
Remove that __init__
and use @:jsRequire("nw.gui", "Window")
Well, @:jsRequire("nw.gui", "Window")
generates exactly require('nw.gui').Window
Thank you very much for quick solution.
To access window.alertify
I used @:native("alertify") on extern class, works fine. Everything works. :+1:
After updating to Haxe 3.2, I tried to compile Haxe/JS project
which depends on those externs https://github.com/HaxeIDE/HIDE/blob/master/libs/nodejs-std/nodejs/webkit/UI.hx
Haxe 3.0: this used to generate
but in Haxe 3.2 this doesn't happens, I tried
@:jsRequire('nw', 'gui')
- doesn't workshttps://github.com/HaxeIDE/HIDE/blob/master/externs/alertify/Alertify.hx#L22
This is basically hack, I need to access
window.alertify
but I doesn't want to create additional variable for it.And they doesn't work anymore, I understand that some of these are hacks(especially second one) and depend on generated code.
Thanks.