Live data from Hacker News

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

news.ycombinator.com

101–110 of 230 posts

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

#101

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.

You've probably used wxUniversal. Try wxOSX/Cocoa, it wraps native controls such as NSButton. You can even get this object and use Cocoa API directly (inside appropriate #ifdef block obviously).

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

#102

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?

Yes the windows link above is for Universal Windows Platform apps which isn't what most people think of when they think "windows app". For React Native on desktop I've been bundling my React app into a Electron shell, works pretty well.

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

#103

Just getting started on Electron myself. Used by Atom, Slack, Visual Studio... It's worth a look ;) Electron - Build Cross-Platform Desktop Apps With HTML, JS, CSS http://electron.atom.io/

Electron only works for desktop applications and probably needs a js-framework to work good. I think that React + Electron looks like a nice combo and then you can use React Native to create Android and iPhone apps also, probably sharing a lot of code between all versions.

+1 on this, I'm having a very pleasant time working on a couple Electron+React apps right now. I've been starting my apps based off https://github.com/chentsulin/electron-react-boilerplate but diverging greatly after getting it running.

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

#104
post #82

Earlier quoted context omitted.

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 th…

Instead of giving me the tools to make a modal pop-up, but then leaving me to match that modal pop-up to the stylistic conventions of each OS GUI, why can't a UI framework give me a "YesNoModalPopup" that looks and acts however a "YesNoModalPopup" is supposed to act on the respective OS—even going so far as to actually be a modal sheet or a command-line prompt instead?

This, I think, is one of the bigger but oft-unstated reasons that people actually prefer to target the web rather than targeting native. Javascript's window.alert() is a function with a semantic behaviour-contract; it will alert the user. It doesn't specify how it'll alert the user, that's up to the browser to define. (And, therefore, up to the user to pick the browser whose definition they enjoy.)

Perhaps what I'm really craving, here, is a XAML-like or XUL-like constraint-based declarative view format, which has a very high-level and abstract set of controls available to be specified. Then, different GUIs could have renderer-clients for this system, that rendered those controls in all sorts of different ways. Maybe you could even mix-and-match your favourite concrete controls, like with browser extensions.

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

#105
post #68

I'm just going to come out and say The Web. Stick WebViews in your app and if you need some native API use a bridge (like PhoneGap). By itself you can already have tons and tons of great UI components that work cross platform. But if you want a web based library specifically designed to present a common interface tailored to each device (desktop, tablet and mobile) and taking advantage of its unique characteristics,…

Just out of curiosity, why did you downvote this? You don't think the Web is a good platform for UI or you don't like that I linked to our library built on top of it that we open sourced for UI?

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

#106
I'll throw in a mention for Xojo:

http://www.xojo.com

Xojo used to be called REALbasic, and it's a cross-platform 'Visual Basic' with support for Windows, Mac, Linux, iOS and Raspberry Pi. I tend to use it for internal tools that need to run on both Windows & Mac, and find it's great for getting to a prototype stage very quickly.

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

#107
post #96
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.

> 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.

The GP didn't say there isn't room, they said that the question is "which one is best", not "which one is good".

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

#108

SWT rarely gets any love in desktop UI threads around here, but I recently wrote a small desktop program using SWT and Java and found it to be a reasonably pleasant experience. The main purpose of the program was to allow the user to view a couple of database tables, and using a tree view widget with columns was a key requirement. SWT is the widget toolkit used by Eclipse and is mostly native, using GTK on Linux, Coc…

To be fair, I feel like most people either would rather not use Java (I know, I know, it's unreasonable considering the language has become much more idiomatic and the tooling is great) or they just associate Java with huge backend, WebSphere kind of projects.

In a way, Java is a victim of its own success.

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

#110
post #109

None, abstract the functionality of your app into a cross-platform library and build a native GUI for each platform you support using that platform's native SDK.

To expand on that, BackBlaze did a blog post on cross-platform tips: https://www.backblaze.com/blog/10-rules-for-how-to-write-cro...
Post reply on HN