Choosing a GUI library for a new project on Apalis iMX6 (Torizon/Linux/WEC)

Hello,

We are planning to upgrade one of our products and as a result, we are also planning to rewrite its GUI. This product is currently running on Windows CE 5 with MFC, with all the risks of obsolescence involved. Our goal is to move to a newer OS and GUI library.
We are considering all the options but we are not really sure what is feasible with the tools provided by Toradex. Your experience could really prove useful to us.

Our needs:

  • The application runs on an embedded device, like some kind of tablet. The target is an Apalis iMX6.
  • The GUI is quite simple, with many basic widgets (buttons, lists, …). Some components are redrawn (graphs, charts).
  • No 3D, nothing very demanding overall.
  • We are not particularly looking for a modern look & feel. For us, the most important is to have a clear and functional GUI.
  • The application is preferably written in C++. Other languages are possible, but this would mean an additional cost for us, as our developers are mainly proficient in C/C++.
  • OS: Torizon, Linux or Windows.

Here is a summary of the options available to us:

  • Qt: the commercial license is way too expensive. The LGPL license is not suited to our case, because we do not want to allow the user to access the file system.
  • Crank: we are considering this option but the price might be a bit too high for us.
  • TotalCross: the language is not suited to our needs, but we have not ruled this option out.
  • GTK and wxWidgets: we found many different opinions about these librairies. For GTK, GNOME is recommended and there is also gtkmm for C++. The problem is mainly the lack of professional support, and this makes us worried. Is this a viable solution?
  • Mono: from what we have read, Mono is mainly used for running applications and not for new projects. Moreover, Mono uses WinForms which is a rather old library. Do you agree with this?
  • Silverlight for Embedded (XAML for Windows Embedded): it would require us to use WEC 7 or 2013, and from what we have seen, these choices are not recommended because of the risk of obsolescence. WEC 2013 support ends in 2023. In addition, the language may be a hindrance at the beginning of the project. Is it still viable to start a new project on WEC 2013?
  • .NET Compact Framework: same as Silverlight. That said, the work involved in learning .NET can be a plus in the long run. The most constraining problem remains the use of an obsolete OS. What is your opinion on this subject?

What other options do we have? Have we missed something? Which libraries would you recommend, depending on our needs?

Greetings @Alsem,

Let me give my thoughts here. I can’t guarantee I’ll be able to give the perfect recommendation here but I’ll comment on what I can.

The GUI is quite simple, with many basic widgets (buttons, lists, …). Some components are redrawn (graphs, charts).

Sounds like then you don’t require HW (GPU) accelerated graphics? This can be a sticking point since some frameworks support the i.MX6’s GPU and some don’t.

The application is preferably written in C++. Other languages are possible, but this would mean an additional cost for us, as our developers are mainly proficient in C/C++.

An additional question I have here, is are you looking to port a previous GUI implementation? Or is starting from scratch the goal here?

Qt: the commercial license is way too expensive. The LGPL license is not suited to our case, because we do not want to allow the user to access the file system.

Have you considered working with free and open source Qt? I do admit you lose quite a bit of ease of use when working with open source Qt but it may be an option. However we have a basic guide on using open source Qt with Torizon: Qt on Torizon OS | Toradex Developer Center

Crank: we are considering this option but the price might be a bit too high for us.

Generally I’ve heard good things about other customers of ours that use Crank. They also provide pretty good support as well. Though there’s not much I can say if your limitation here is the price.

TotalCross: the language is not suited to our needs, but we have not ruled this option out.

Here we have another open source option. Even though it’s open source we’ve found that TotalCross (the company) is more than willing to provide support.

GTK and wxWidgets: we found many different opinions about these librairies. For GTK, GNOME is recommended and there is also gtkmm for C++. The problem is mainly the lack of professional support, and this makes us worried. Is this a viable solution?

Yeah while this is possible my concerns here are the age and support of some of these projects. GTK on Linux especially is a bit of a gamble when it comes to what works and what doesn’t.

Mono: from what we have read, Mono is mainly used for running applications and not for new projects. Moreover, Mono uses WinForms which is a rather old library. Do you agree with this?

Mono is a possibility as I’ve seen other customers use this. However it’s more of an option for porting old projects from Windows to Linux without starting completely from scratch. As you said though it’s all based on rather old stuff and not very future-proof in my opinion.

Silverlight for Embedded (XAML for Windows Embedded):

I’m not a WinCE expert so I can’t comment much on this. However I will say the end of support for WinCE is definitely something to consider and whether this affects you or not. Though with al that said this is probably the least future-proof option.

.NET Compact Framework

Compact framework has a somewhat similar issues as with Silverlight in terms of future long term outlook. However .Net specifically .Net Core is a viable option. There’s many different .Net Core frameworks for UI/GUIs out there. For example we have a sample application for ASP.NET Core and Blazor: How to Build a GUI with ASP.NET Core and Blazor for Torizon OS | Toradex Developer Center

With all those comments I will additionally add that for Torizon we have a list of articles about various GUI frameworks we’ve tried: Torizon | Toradex Developer Center

For the most part though it looks like you’ve already considered everything listed though. I hope my comments and feedback helped with your decisions a bit. In the end though I can only recommend GUI frameworks we’ve tried and tested ourselves. Anything else is a bit of gamble on what the result will be.

Best Regards,
Jeremias

Hi @Alsem
I think that in your case Dear ImGui can be a good choice if you want to develop in C++

You can find a lot of documentation online.
If you need charts you can look to ImPlot

Both of them are licensed under permissive MIT license.

If you prefer C (not C++) and your requirements are quite simple, you can look to Nuklear

All of them are actively developed and supported.

“Immediate mode” can be a little bit confusing at a first sight, but it’s cool.
It has its own drawbacks, but it’s powerful.

Hello @jeremias.tx,

Thank you for your detailed answer. You have provided valuable information that will help us to confirm our choice.

Sounds like then you don’t require HW (GPU) accelerated graphics? This can be a sticking point since some frameworks support the i.MX6’s GPU and some don’t.

Yes, absolutely. We don’t need the GPU but if the library supports it, then it’s a plus.

An additional question I have here, is are you looking to port a previous GUI implementation? Or is starting from scratch the goal here?

We are definitely starting from scratch. We plan to rewrite the whole application.

Have you considered working with free and open source Qt?

Is open source Qt the same as the LGPL license? This is an option that we’ve looked at, and it has some issues. It’s quite tricky because we have to be sure that we are following the contract in its entirety. To summarize what we know about it, in the case of the LGPL, the user has to be able to replace the DLLs whenever he wants. We could allow the user to access the file system. However, this solution would not be ideal because the user could inadvertently break the interface, which would entail a maintenance operation that can be troublesome on an embedded device.

Generally I’ve heard good things about other customers of ours that use Crank. They also provide pretty good support as well. Though there’s not much I can say if your limitation here is the price.

This is great news. We’re still considering this option, and while it’s true that the price is a major factor, I have to say I’m really impressed with Storyboard’s potential.

Here we have another open source option. Even though it’s open source we’ve found that TotalCross (the company) is more than willing to provide support.

It is really great to know that the support is well handled by the company.

Yeah while this is possible my concerns here are the age and support of some of these projects. GTK on Linux especially is a bit of a gamble when it comes to what works and what doesn’t.

This is what we thought. We definitely need something more robust.

However .Net specifically .Net Core is a viable option. There’s many different .Net Core frameworks for UI/GUIs out there.

Thanks for bringing that up in your reply. Could you please give us more examples of .NET Core frameworks for UI/GUIs? Are there any other frameworks suitable for desktop application development?

I hope my comments and feedback helped with your decisions a bit. In the end though I can only recommend GUI frameworks we’ve tried and tested ourselves. Anything else is a bit of gamble on what the result will be.

Your help has been great. Again, thank you for taking the time to answer us in such a precise manner, it is much appreciated. Choosing a framework for a new project is not an easy task.

Hello @vix

Thank you, that’s very interesting, we will definitely consider these options.

Regarding ImGui, do you know of any applications that make full use of this library? So that we can have an overview of its features.

No, Open Source is different from LGPL.
Open Source means that you have to release all the source code of your application.
For LGPL, you can use in a proprietary application but you must comply to the clauses of the license.
Here are some useful details on using Qt under LGPL (credits to Burkhard Stubert who is an expert):

If I’m right (but I’m not an expert), “the user has to be able to replace the DLLs whenever he wants” is the anti-tivoization clause of LGPLv3, but this apply only to B2C (Business-To-Consumer) devices (i.e. “personal” devices, that belongs to the end-user). This doesn’t apply to B2B (Business-To-Business) devices.
If you’re interested in using Qt under LGPL you should investigate this topics deeply.

Here you can find a list of projects that use ImGui.

I know that some vendors develops their HMI for industrial machinery using InGui (but I can’t disclose the names, sorry).

Here are some useful details on using Qt under LGPL (credits to Burkhard Stubert who is an expert):

If I’m right (but I’m not an expert), “the user has to be able to replace the DLLs whenever he wants” is the anti-tivoization clause of LGPLv3, but this apply only to B2C (Business-To-Consumer) devices (i.e. “personal” devices, that belongs to the end-user). This doesn’t apply to B2B (Business-To-Business) devices.

Here you can find a list of projects that use ImGui.

Thanks for the links, it will help us a lot. It is much appreciated.
We will look at the LGPL license to check if this option is viable in our case.

@Alsem,

Choosing a framework for a new project is not an easy task.

Perhaps a consultative call/meeting with Toradex would be more appropriate in this case. Or if you’re more curious about the GUI offerings from our partners (Totalcross, Qt, Crank, etc) perhaps a call with them may help as well.

Let me know how this sounds and I can see if can arrange a call with someone from the Toradex side.

Best Regards,
Jeremias

Thank you, @jeremias.tx.
We contacted your partners. I think we have all the information we need to choose the right library.

That’s great to hear! I’m glad I was able to provide some input for your decision.