HaxeUI best approach?

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.

This might help you out a little: Getting Started - HaxeUI

Cheers,
Ian

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.

2 Likes

You could go even further and add a message on every build with extraParams.hxml and a build macro.

1 Like

Yeah, good points… i think ill do that, and maybe a deprecation notice in the code, or something in the hxml - makes a lot of sense.

Cheers guys!
Ian

2 Likes

ianH,
Thanks for the explanation.
I have haxeui-core 1.1.3.
I think my real problem is using tutorials/examples for older versions of haxeui.

I battle on… ianU

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… :frowning:

For now (for you) i would use the guide on the website: Getting Started - HaxeUI
You can also find info on the forums: https://community.haxeui.org/
And I am (and others are) usually about on the discord: https://discord.gg/rkSyrQmx

Hope that helps somewhat

Cheers,
Ian