haxeui / haxeui-hxwidgets

The hxWidgets backend of the HaxeUI framework -
http://haxeui.org
MIT License
23 stars 7 forks source link

Template ? #23

Closed melMass closed 5 years ago

melMass commented 5 years ago

Thanks a lot for HaxeUI!

I'm wondering if you have made a template for native (wxWidget) yet? I want to convert a Qt C++ app I made to HaxeUI but I can't find the most basic example using the hxWidgets backend.

Simply adding the dependencies to my project results in the following error...

Type not found : haxe.ui.backend.ComponentImpl

Edit: Using Haxe 4 on MacOS

melMass commented 5 years ago

My bad I missed the installation of haxeui-hxwidgets, the readme is bit confusing (one command using git, the other dev for two different dependecies)

ianharrigan commented 5 years ago

ah, yeah, these are all haxelibs now, so all that info doesnt really matter now - ill fix the readme... thanks for the reminder!

ianharrigan commented 5 years ago

Is that a little clearer now? This issue closable if so?

Cheers, Ian

melMass commented 5 years ago

Thanks! Installation wise yes, but I still can't find/run the most basic sample, I tried to look at the haxe-ui-templates/command-line ones but I seem out of date.

ianharrigan commented 5 years ago

yeah, i updated the haxeui-core readme too...

run haxelib run haxeui-core create hxwidgets in an empty dir... should create a basic project for you

melMass commented 5 years ago

Oh great feature!

It returns:

sh: neko: command not found

I guess it's not Haxe 4 ready ?

ianharrigan commented 5 years ago

hmmm, thats strange, im using haxe4 at the moment with no issues... seems like you dont have neko installed (which should be part of the haxe installation and haxelib run relies on it). Looks like you are using linux, maybe there are extra steps to get neko working on your system? Ive never had any issues on win / mac / linux...

If you cant get it running then i can always run it here and zip up the result - would probably be useful for you to be able to run neko anyway though

melMass commented 5 years ago

I thought Neko was deprecated. I'll have to catch up on that. I'm using macOS, I'll look at how to get Neko, but in the meantime, if you can zip up the template that would be useful, thanks for your quick reply.

ianharrigan commented 5 years ago

Rightyo, here you go:

skeleton.zip

melMass commented 5 years ago

I'm getting the following:

Warning : Should be used in initialization macros only: haxe.macro.Compiler.define(source-header, GeneratedByHaxe)
/usr/local/lib/haxe/lib/haxeui-hxwidgets/git/haxe/ui/backend/hxwidgets/behaviours/ListViewDataSource.hx:16: characters 14-28 : hx.widgets.ListView has no field deleteAllItems
ianharrigan commented 5 years ago

have you got a totally up to date hxWidgets?

melMass commented 5 years ago

Nope !! Running:

haxelib git hxwidgets https://github.com/haxeui/hxWidgets.git

Solved the issue on the Haxe side, but the cpp build errored out. I had to add -D disable-unicode-strings because of a known issue apparently (see here)

image

melMass commented 5 years ago

Thanks for the support! I already tried and failed a few times (in the past year) before deciding to open an issue

ianharrigan commented 5 years ago

OK, thats interesting about the issue linked... so does that work now? Its strange that your button has white text... dont quite understand that... i get that text is squashed as osx doesnt like "random" button sizes but how come the text is white???

melMass commented 5 years ago

I got that on the console, might be related:

19:09:49: Debug: wxColour::Set - couldn't set to colour string 'CYAN'
19:09:49: Debug: wxColour::Set - couldn't set to colour string 'GREY'
19:09:49: Debug: wxColour::Set - couldn't set to colour string 'LIGHT GREY'
19:09:49: Debug: wxColour::Set - couldn't set to colour string 'MEDIUM GREY'
ianharrigan commented 5 years ago

it shouldnt be trying to set the colour at all... building a version on my mac now to see if i get the same

melMass commented 5 years ago

hx_css

ianharrigan commented 5 years ago

image

Ok, so my guess its because you have dark mode enabled and are using an older version of wxWidgets? I usually build from source (which is super easy btw, let me know if you want instructions - might make sense to put them on the hxWidgets repo), also, wx 3.1.3 was just released which i think fixes alot of these types of issues (i know i had issues with dark mode until i built from source)

How does it look when you are using light mode?

EDIT: what does wx-config --version show?

ianharrigan commented 5 years ago

OK, i added instructions on how to build from source here: https://github.com/haxeui/hxWidgets#building-wxwidgets-from-source-linux--osx

Its an easy build and well documented but its useful being there, even if just for me :)

melMass commented 5 years ago

Yes exactly, all working now! Side note, you should not have to sudo make install but simply make install as it defaults to /usr/local

ianharrigan commented 5 years ago

great...glad its all working! Im vexed by buttons not being able to be bigger - looking at it now, but i think ive been down this rabbit hole before

(ill remove the sudo and make a note - i think i read somewhere that it may be needed, so just added it "just because")

ianharrigan commented 5 years ago

https://stackoverflow.com/questions/29083891/wxpython-button-size-being-ignored-on-osx

ianharrigan commented 5 years ago

Can this be closed now?

melMass commented 5 years ago

Yes thanks again!