Help installing HaxeUI + hxWidgets + haxeui-hxwidgets on Debian GNU/Linux

I’d like to get HaxeUI + wx set up on my Debian system, but have a few questions.

Note, I’m using Haxe 4.0.0-rc.2. Will HaxeUI work with Haxe 4?

***

I believe the calls/dependencies go like:

my code → haxeui-core → haxeui-hxwidgets → hxWidgets → wxWidgets → wxGTK → GTK+3

Is that correct?

I’ve apt installed libwxgtk3.0-gtk3-dev and libwxgtk-webview3.0-gtk3-dev (the former pulls in libwxbase3.0-dev as a dependency).

Note: I think libwxgtk3.0-gtk3-dev is the one for GTK+3, whereas libwxgtk3.0-dev (as specified in the hxWidgets readme) would be for GTK+2. My understanding is that hxWidgets shouldn’t care which version of GTK+ is used under the hood, right?

Anyhow, this gives me:

$ wx-config --version
3.0.4

So I believe the next step is to install hxWidgets.

I first grabbed hxcpp (haxelib install hxcpp, which gets me version 4.0.19).

Do I now just install hxWidgets, then haxeui-hxwidgets (in that order) via haxelib?

After haxe install hxWidgets, how do I build the samples/00-Showcase?

I’m not using any IDE. Just the terminal and my text editor.

I tried:

cd ~/haxelib
cp -r hxWidgets ~/temp
cd ~/temp/hxWidgets/1,0,6/samples/00-Showcase
haxe build.hxml

and it got pretty far before:

{snip}
 - src/hx/widgets/ClassInfo.cpp 
 - src/views/HTMLView.cpp 
 - src/hx/widgets/Pen.cpp 
 - src/hx/widgets/Icon.cpp 
 - src/__boot__.cpp 
Error: In file included from include/hx/widgets/OwnerDrawnPanel.h:14,
                 from ./src/__boot__.cpp:242:
/home/john/haxelib/hxWidgets/1,0,6/include/custom/wxownerdrawnpanel.h:4:10: fatal error: /home/john/temp/hxWidgets/1,0,6/samples/00-Showcase/bin/obj/linux64/__pch/haxe/hxcpp.h: No such file or directory
 #include <hxcpp.h>
          ^~~~~~~~~
compilation terminated.
Error: Build failed

Are you using new-component-method branches of haxeui-core and haxeui-hxwidgets? You’ll need to… if you are, then you’ll need to pull again, i fixed an issue similar to this today

No, I wasn’t using that branch, but so far I haven’t installed either of those yet! :slight_smile:

Do I need those to get that hxWidget showcase built and running? I thought maybe no, if my little “train diagram of calls” (in above post) is correct. Is it?

Yeah, that flow is right if you get the show case working first with hxwidgets thats the best thing haxe ill make a new haxelib release for hxwidgets…

ok, latest haxelib (1.0.7) should fix your issues

Thanks, Ian.

Ok, I installed hxWidgets 1,0,7, copied it to ~/temp again, and tried building again but got:

~/temp/hxWidgets/1,0,7/samples/00-Showcase$ haxe build.hxml 
Error: Error: Library hscript is not installed : run 'haxelib install hscript'

Called from haxelib/client/Main.hx line 1318
Called from haxelib/client/Main.hx line 1353
Called from haxelib/client/Main.hx line 422

So I did haxelib install hscript (got me v2.3.0) and tried again. It gave some notes and warnings, but made it to the end:

{snip}
Compiling group: hxcpp_std
g++ -c -fvisibility=hidden -O2 -fpic -fPIC -Wno-overflow -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=400(haxe) -m64 -DHXCPP_M64 -I/home/john/haxelib/hxcpp/4,0,19/include ... tags=[haxe,static]
 - File.cpp 
 - Random.cpp 
 - Socket.cpp 
 - Process.cpp 
 - Sys.cpp 
Link: Main

Ran it like ./bin/Main and it opened! Yay! :smile: though with some errors like:

(Main:4481): Gtk-CRITICAL **: 13:01:43.497: gtk_box_gadget_distribute: assertion ‘size >= 0’ failed in GtkScrollbar

Here’s a screenshot:

Can you please tell me the haxelib command line invocations to get that new-component-method branch of haxeui-hxwidgets and haxeui-core?

Edit: Actually, I see the docs at https://lib.haxe.org/documentation/using-haxelib/ . Will have a try tomorrow.

Sorry, late reply, this might help: https://lib.haxe.org/documentation/using-haxelib/#git

Thanks, Ian. No worries.

Looking at the haxeui-hxwidgets repo, https://github.com/haxeui/haxeui-hxwidgets , in the readme, it says:

haxelib git haxeui-core https://github.com/haxeui/haxeui-core
haxelib dev haxeui-hxwidgets path/to/expanded/source/archive

Is that a typo? The first command is haxelib git and the second is haxelib dev, but both commands are for different libs (the first being haxeui-core and the second haxeui-hxwidgets). I don’t understand what haxelib dev does, and so will ask about it on the main Haxe forum.

Ok, well, I’ve installed the remaining two parts of HaxeUI:

haxelib git haxeui-hxwidgets https://github.com/haxeui/haxeui-hxwidgets new-component-method
haxelib remove haxeui-core
haxelib git haxeui-core https://github.com/haxeui/haxeui-core new-component-method

Not sure if that’s correct, but it seems to have worked fine.

(That haxelib remove is in there because the first command pulled in what looked like an older 0.0.4 haxeui-core release as a dependency, and I wanted to make sure I got the freshest haxeui-core.)

I began writing up some notes on this, but the doc is still incomplete:
http://unexpected-vortices.com/haxe/gui-haxeui-wx.html

Can you point me to a sample hello-world HaxeUI app?

What compiler args are required to build it?

Thanks!

haxelibs can come with a “run” command that can … … … run certainly things and operations, helpers, etc. HaxeUI2 comes with one such command. So, if you open a blank folder and type:

haxelib run haxeui-core create hxwidgets

This should create a very basic “Hello World” application in that dir… You dont need to use that command ofc, it only creates files for you… but its a good starting point. :slight_smile:

Cheers,
Ian

Thanks, Ian!

hxwidgets-hello-world

1 Like

No problem! Mind if i share your tutorial? It seems straight forward and well written (unlike any of mine :smiley: )

EDIT: also, out of interest, is the window in that screen shot resized? Because it shouldnt be that “big”

Mind if i share your tutorial?

Please do. Hope it helps others, but it’s more of a getting-started doc than a tutorial. Incidentally, I changed its link to:
http://www.unexpected-vortices.com/haxe/gui-haxeui-wx-gtk/getting-started.html.
The doc ends with me kinda’ stuck, as I don’t really know how to proceed…

Is there a list of apps made with HaxeUI so I can look at their source code?

If you know of any existing HaxeUI tutorial material out there, even videos, please let me know!

BTW, yes, the default demo app opened up a window that was too small:

haxeui-too-small

so I resized it before taking the screenshot (made a note about that in my little getting-started guide).

Hmmm… ok, good to know. Ill see if i can reproduce and if its a haxeui-hxwidgets issue or an issue with wxwidgets itself.

Cheers,
Ian

Thanks for publishing that! Just a quick issue I noticed under Prerequisites → Haxe:

If you don’t already have Haxe installed, see my Haxe setup doc.

That link links to the page you’re already on.

Whoops. Thanks. Fixed link.

1 Like

Also updated it since 1.0 was released and we can now install via “haxelib install” rather than “haxelib git”.

2 Likes