If you were going to build a GUI for a cross-platform desktop application, what would you use?
I haven’t seen a lot of desktop app content in discussions/articles on DEV, so I thought I’d start one! Just curious how others would approach the task.
Parameters:
- You cannot use Electron
- The GUI is decoupled from other app code and communicates via some local RPC/API
- You can use commercially licensed libraries/frameworks
I’m currently involved in maintaining an existing cross-platform desktop app, and have been thinking about some different approaches:
- Serve the GUI as a locally hosted site. Users interact with the app’s GUI in the browser of their choice.
- Separate codebases: use Cocoa/native libraries for Mac, Qt for Linux, WPF for Windows.
- Single codebase: Use Qt or wxWidgets for all platforms. (This is the approach I use today)
So... how would you do it? What choices would you make?
Unless I really need high performance, probably as a locally hosted site, most likely using whatever the standard native web server is for the backend environment, or H2O if it's C/C++. Taking this approach eliminates a significant percentage of the work you would have to do to get the RPC interface working for whatever native environment you might choose to use, and as much as I dislike JS, it's really good for event-based programming, which is really how you should be doing your UI logic.
Barring that, most likely Qt, after taking the time to learn it.
The problem with the split code-base approach is that it makes it harder to keep track of feature-parity among your different UI's, especially since one person can't as easily implement feature XYZ for all platforms as they can with the other two approaches.