4

yesterday I stumbled across the Haxe NME project, which is a very promising idea. However, it is still not possible to build sophisticated UIs with this framework. In my opinion it seems to be a intimidating task to build a UI framework that targets so many different platforms, hence I think that this isn't a viable approach, because even old and mature UI frameworks like Qt and wxWidgets don't support so many platforms.

However, it could make sense to build a platform specific UI with help of some pretty UI designer tool and then connect the UI code to the UI agnostic code that has been written in Haxe. I don't know if this could work, because I couldn't find any example, but maybe someone who has already written some MVC Haxe code, that could be successfully connected to different platform specific UIs, would like to share his experiences. Thanks.

user1812379
  • 747
  • 3
  • 10
  • 19

3 Answers3

12

You say:

However, it is still not possible to build sophisticated UIs

Just because you haven't yet figured out how to do it doesn't mean it's not possible ;)

The reason it is possible is that in the Haxe ecosystem, the language and compiler is extremely consistent cross platform, NME/OpenFL provides a fairly strong cross platform rendering environment (HTML 5 has some quirks, but the others seem fairly strong) and so anything you build on top of these is going to cover a lot of platforms out-of-the-box. It's about being fairly high level - letting the compiler and the libraries take care of the platform quirks.

In MVC, the UI stuff is usually the "View". For View / UI frameworks, check out these libraries:

  1. Stablex UI
    NME/OpenFL, Cross Platform. Draws components using NME API. This is the only one I've played with, but the demo works consistently on android, flash, html5, native linux. Pretty impressive.

  2. HaxeUI
    NME, Cross Platform. Again, draws components on the stage.

  3. Prime
    Drawn using Flash API. Not sure if it has been ported cross platform yet.
    See also Talk/Video from WWX conference and Slides

  4. Guise
    A really innovative way of being able to either draw the UI, or use native if available. Check out the blog post.

  5. Basis
    Another attempt at wrapping native components - has iOS and Android libraries so far. Pretty cool, but I haven't played with it yet.

For MVC, there are lots of options:

  1. PrimeVC, mentioned above.
  2. MMVC, based on the RobotLegs framework, but tailored for Haxe.
  3. Lots of small options BBMVC PureMVC etc

The advantage of the MVC frameworks is that they separate your views from your application data (model) and logic (controller). Try to spend some time familiarising yourself with one of the MVC frameworks, and you'll see how you can write your apps in a way where you could use one of these, and then any of the various view engines - either native or NME-rendered. It can be a fairly steep learning curve, but this is how you build apps that are easily portable between different UI frameworks, and easily testable so you know they will scale as the app grows in complexity.

Jason O'Neil
  • 5,628
  • 2
  • 24
  • 26
  • Thanks. I know those Haxe UI frameworks, but they don't contain a lot of components. I would be very glad if I could use an arbitrary UI framework like wxWidgets, Qt or Flex mxml and then glue the external UI on top of the model and controller classes that are written in Haxe. Would that be possible? – user1812379 Jul 01 '13 at 20:29
  • Yes, but that's also a very small project that might vanish sooner or later. If it should be somehow possible I would like to use Haxe in conjunction with a large UI framework. – user1812379 Jul 02 '13 at 15:25
  • That project is using wxWidgets, which you asked about, and is compatible with NME. I think someone did GTK bindings, but I haven't heard in a while so they might be outdated. If you're looking for a UI framework with a lot of momentum already, Haxe might not be the right choice for you. It's a great language, but the community is still small so you have to be willing to live with the uncertainty (for now at least) – Jason O'Neil Jul 02 '13 at 23:56
0

The main problem you seem to face is that there is no out of the box option that is complete and ready for you to use. The multitudes of project people are suggesting do what you want. You need to be willing to use them. A small project on github may be dropped. If so it will be dropped because jo one uses it so its up to people who would like to use it (ie: you) to keep it going.

Everyone can't siphon of others completed projects or nothing would ever be created. Participation is what opensource is about.

loogie
  • 1
0

Doesn't make sense to have a unified UI for all platforms, every platform have diferent workflow, have you tryed to use a IOS listbox on windows , is simply ridiculous. On the other hand a good design could separate the view from the bussines logic and you can share the bussiness logic with all targets and tweak the views for every target. look at PureMVC
for a mvc example in Haxe