Gentlefolk,
I am trying to use HaxeUI to develop a small application to display some historical data in a browser (HTML5).
The basics are working Ok but…
Searching through the HaxeUI eco system I find multiple methods of building an xml-haxe app.
One approach is the “Toolkit” but when I try to utilise that there are problems like finding Toolkit.openFullscreen.
Another appears to be simply to use
var mainView:Component = ComponentMacros.buildComponent(“assets/main-view.xml”);
app.addComponent(mainView);
and then add haxe objects and then establish relationships to the xml objects.
Multiple tutorials, explanations, etc are not really helping.
Any ideas, suggestions directions appreciated, Ian.
Hey, it sounds like you are using the wrong version of haxeui… ie, “haxeui” in haxelib… this is a very very old version of haxeui (an openfl only lib) that is no longer supported / developed. The new version of haxeui is called “haxeui-core” on haxelib and github (HaxeUI · GitHub) and uses multiple backends (haxeui-openfl being one of them) - this is defo the version to use, and maybe even the git version (though haxelib version should be fine also).
The reason im suspecting this is because Toolkit.openFullscreen is no longer a thing. As for usage you should just be able to init and use, ie (im assuming openfl here):
Toolkit.init();
var b = new Button();
b.text = "Button";
addChild(b); // add it to the openfl sprite since in haxeui-openfl components just end up as sprites
If you are using one of the native backends (like say hxwidgets) then its probably easier to use the generic HaxeUIApp:
var app = new HaxeUIApp();
app.ready(function() {
var b = new Button();
b.text = "Button";
app.addComponent(b);
app.start();
});
This will start up the wxeventloop, etc - note you dont have to do this, you can just use a normal wx app and start the loop / main window yourself, also note this type of usage works with all backends also - its an optional help class essentially.
PS: it would be really nice to be able to rename the “haxeui” haxelib to “haxeui-legacy”, but deleting / renaming isnt a thing in haxelib - i get why - but it’d still be nice and i get this confusion too often
Maybe you could publish a new version of the “haxeui” haxelib that is exactly the same as the previous version, except that the README file explains that this haxelib is now considered a legacy version. Then, include some links to the newer haxeui-core so that people know where to get started.
Yup agreed - cant really do much about that unfortunately - some of the general principles remain the same, but yeah, especially if they install using a guide for v1 it’ll lead to all types of issues…