Live data from Hacker News

Ask HN: What's the best library for making cross-platform UIs?

news.ycombinator.com

91–100 of 230 posts

Re: Ask HN: What's the best library for making cross-platform UIs?

#91
post #82
post #62

Earlier quoted context omitted.

"wxwidgets has a very antiquated feeling to the API" This should not be relevant in any professional technical discussion. Last time I looked there was not an overflowing oversupply of cross platform UI frameworks. "it didn't ship high DPI support " This, on the otherhand, might be a critical deficit.

At least on Windows, there's a new UI API every 7 years. MFC, Winforms, WPF... Maybe "wxwidgets has a very antiquated feeling to the API" really means that platform-neutral concepts do not encapsulate well when keeping the UI truly native?

Cross-platform with a single code base has always been a bit of a myth, if only because different platforms have different conventions for things like how to lay out dialog boxes or the writing style used for buttons. If you want something that feels like a native application on different platforms, it's always going to require some level of customisation.

It's still useful to have a single UI library in your code that you can tell to make a text box or open a menu or draw some graphics and have it translate into the correct API calls on each platform under the hood. For all the much-touted rearrangements of UIs, particularly in recent versions of Windows, the reality is that most of the familiar GUI controls haven't really changed that much in decades.

I think the biggest difficulty for any attempt at a cross-platform GUI framework today is probably making sure it does properly handle the widgets or behaviours that really are different or unique on each platform. More generally, if you're building for multiple platforms you also have to deal with all the installation and updating and sandboxing and so on that tends to be completely different from one OS to another, and often the GUI libraries and UI integration is a big part of that too.

Re: Ask HN: What's the best library for making cross-platform UIs?

#92
http://sciter.com

Embeddable HTML/CSS UI engine designed specifically for desktop UIs.

The "Embeddable" here means that: - it is a compact (3...4mb) monolithic DLL/dylib/so without external dependencies. - can be linked statically if needed. - has simple plain C API of 20-30 functions - C++,C#,Rust,Go,Delphi,Python wrappers.

Same UI resources are used on all platforms: http://sciter.com/images/sciter-clock.png

Check technology introduction article:

http://www.codeproject.com/Articles/859098/Sciter-multiplatf...

Re: Ask HN: What's the best library for making cross-platform UIs?

#93
It depends on what language you're using and your requirements, but my preference is Qt. It has bindings to several languages; it supports most common platforms; the API is consistent, stable, and well documented; and it's easy to get up and running on all of the platforms it supports.

One complaint people have about Qt is that it doesn't "look native" enough. That's not something I personally care about, and it's not a problem at all for the applications I write, but it's an issue for some people. IME, that's just a trade off of using a cross-platform GUI library. If the layout is good and it's easy to use, most people won't care if it doesn't look native. Photoshop doesn't "look native" either, yet it has a huge following and brings in a ton of money.

Re: Ask HN: What's the best library for making cross-platform UIs?

#94

Strange nobody mentioned wxWidgets so far which gives you true native apps, so I'll do it: http://wxwidgets.org It provides API layer which compiles to Win32 API on Windows, Gtk2 on Linux and Carbon/Cocoa on Mac OSX. Qt only emulates Windows controls, but wxWidgets uses the actual Windows controls via Microsoft Win32 API. BTW, there's wxQt, a wxWidgets implementation that uses Qt instead of Gtk, but it's still experi…

Not against wx by any means, but I actually tried it recently on osx and it drew most controls manually on a canvas of its own. So "xplatform nativeness" is not a selling point for wx.

Against which toolkit did you compile? Carbon, Cocoa or X11?

Re: Ask HN: What's the best library for making cross-platform UIs?

#95

React Native supports * iOS * Android * OS X https://github.com/ptmt/react-native-macos * Windows https://github.com/ReactWindows/react-native-windows * Ubuntu https://developer.ubuntu.com/en/blog/2016/08/05/introducing-... * the web https://github.com/necolas/react-native-web

AFAICT, it isn't "Windows", but "Windows 10 only".

Is this correct?

Re: Ask HN: What's the best library for making cross-platform UIs?

#96
post #62

Earlier quoted context omitted.

In my experience with it, wxwidgets has a very antiquated feeling to the API (I know, subjective) and it didn't ship high DPI support when I used it. Its Python bindings at the time felt rather unpythonic. Generally I wouldn't want to use this again.

"wxwidgets has a very antiquated feeling to the API" This should not be relevant in any professional technical discussion. Last time I looked there was not an overflowing oversupply of cross platform UI frameworks. "it didn't ship high DPI support " This, on the otherhand, might be a critical deficit.

> This should not be relevant in any professional technical discussion. Last time I looked there was not an overflowing oversupply of cross platform UI frameworks.

That latter sentence kinda defeats the argument in your first sentence.

If there's a dearth of options, then there's room for a better API.

Re: Ask HN: What's the best library for making cross-platform UIs?

#97

Strange nobody mentioned wxWidgets so far which gives you true native apps, so I'll do it: http://wxwidgets.org It provides API layer which compiles to Win32 API on Windows, Gtk2 on Linux and Carbon/Cocoa on Mac OSX. Qt only emulates Windows controls, but wxWidgets uses the actual Windows controls via Microsoft Win32 API. BTW, there's wxQt, a wxWidgets implementation that uses Qt instead of Gtk, but it's still experi…

My experience of wxWidgets wasn't very good, Qt is a much better quality project.

Re: Ask HN: What's the best library for making cross-platform UIs?

#98
There's a lot of great web-tech based solutions. Other commentors are covering those, so I'll suggest something different: For a take outside of the web, Golang with OpenGL bindings has a lot of promise for shipping $everywhere.

The https://github.com/go-gl github org has repos with comprehensive pre-generated OpenGL linking. When building off these, you need almost zero interaction with any host libraries. Cross compiling is a breeze. I made a demo application on Linux one afternoon to try it out: I was able to hand the code to a friend with a Mac, and he compiled and ran it first try. It's hard to understate the level of "wow" there.

Golang+GL also ships to mobile devices. There's a little squeeze dealing with the app stores, but fundamentally, build on GLES2 and you can go anywhere.

https://github.com/google/gxui/ is one library on top of these foundations that went all the way to providing (beautiful!) cross-platform widgets that can be used to quickly build a desktop application.

Unfortunately, gxui, though a very attractive proof of concept, is now unmaintained. (At the same time, it's worth mentioning that it still works; there's no insane deprecation schedule or fast-moving/fast-breaking libraries to wreck your day here.) If anyone Out There is interested in renewing this project or starting more frameworks like this, I'd love to collaborate.

Overall, there's work to do here, but if you have some appetite for cutting edge, the foundation is in place to nail portability properly.

Finally, this is unrelated, but I feel compelled to give an anti-pitch to pretty much everything in C/C++ ecosystem of GUI tools: it's a landscape of last decade's promises, and today's despair. I've had comrades complain bitterly over time they've spent in codebases where the wxwidget string objects got out of hand. I have a half dozen applications suffering from various C++ linker hells on my various computers and can't recommend QT with a straight face. I still haven't gotten all my gtk3 and gtk2 configs to line up on my last debian reinstall and all the font sizes are fragged on the computer for no known reason (I literally the gtk configs in my dotfiles in git; I can't imagine how different machines drift)... And I haven't even said a word about build and shipping infrastructure required to really tackle cross-platform. I'll say it again: the entire C/C++ ecosystem of GUI tools is a landscape of despair.

Re: Ask HN: What's the best library for making cross-platform UIs?

#100

GTK may have a difficult API, but it is portable and it gives a better feel than Qt for Linux+Gnome users like me (I will always choose a GTK app over a Qt app).

GTK+'s Windows support is mixed. It mostly works, but bugs reports don't seem to get much attention and you're on your own if you want Windows binaries. macOS support is effectively an afterthought. The only teir 1, actively supported platform appears to be Linux which makes me wonder why the project advertises itself as "cross-platform."
Post reply on HN