Live data from Hacker News

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

news.ycombinator.com

131–140 of 230 posts

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

#131
post #57

I'm barely a geek, let alone a hacker, but have been trying to learn NativeScript for the past month or so. You might want to check it out. Not sure how it compares as a "library" or "framework" etc. I'm still figuring out where the lines are drawn. http://docs.nativescript.org Emulator Here: https://docs.genymotion.com

No Javascript, sorry.

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

#134

For a file manager I'm developing [1], this question recently boiled down to Electron vs (Py)Qt. I chose (Py)Qt because Electron's startup speed is too slow. [1]: https://fman.io

How are you handling licensing? Are you using the commercial version of PyQt? I've been thinking of distributing some apps I've built but I don't want to make them GPL (I don't mind using MIT or BSD though).

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

#135

It depends on what you mean by, "cross-platform." In my world there is no such thing. You pick your target platforms and program to them. However it is common to imply "major platforms" (ie: iOS , Android , Windows 10 , OSX ). Different platforms have different requirements and will shape your solution. Next... what is the application? Do you need to target native APIs? Do you have memory limitations? If you don't mi…

> there is no such thing

Why?

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

#136

What is the best depends on your exact requirements but three good options to get a GUI off the ground quickly are Tk [1], wxWidgets (and wxPython [2] and wxLua [3] in particular) and Lazarus (LCL) [4]. Tk widgets look native on Windows and macOS (if you use the right ones — see [5]), though their behavior is implemented by Tk itself. On Linux it draws its own widgets in several styles; GTK and Qt theme support is im…

Tk is antiquated (no antialiasing [1]) and has a poor look on Linux. It lacks functionality in widgets such as embedding a progressbar in a tree/list (don't remember) widget, which Qt supports. Also, poor font rendering support. (doesn't render Devanagari and probably CJK scripts). It feels like a 10 year old tech which it is. (1) Maybe there is some option for it somewhere, but if so, having antialiasing disabled by…

Tk is 25-year-old tech, not 10. ;-) It has also maintained backwards compatibility since 1997 or so, which is a nice feature to have in many cases but comes at a price. For example, you have to know to use a "ttk::button", not a plain "button", to get the native (Windows, macOS) or a least the somewhat better-looking (*nix) widget. The result is that old Tk software still runs unchanged instead of forcing its maintainers to upgrade, but it looks bad and outdated, contributing negatively to Tk's general image.

The poor look on Linux is definitely a big downside. You can ameliorate it somewhat with a custom theme [1] but your GUI will still look out of place in any major desktop environment. TileGTK and TileQt [2] aren't maintained.

I haven't used it myself, but Tk has at least some CJK support [3]. One thing to keep in mind from the start, though, is that Tcl/Tk suffers from a UTF-16 code unit limitation similar to Java's; it only handles the Basic Multilingual Plane [4] natively.

As for antialiasing, what do you mean when you say it is disabled by default? Is that in a particular Linux distribution? A recent Tk release (post-Tcl 8.5) should render antialiased text unless you compile it with "--disable-xft" or your font is raster.

[1] E.g., http://chiselapp.com/user/skoro/repository/tclapps/artifact/....

[2] http://www.tclcommunityassociation.org/wub/proceedings/Proce...

[3] Per https://tcl.wiki/CJK.

[4] https://en.wikipedia.org/wiki/Basic_Multilingual_Plane

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

#137
post #104

Earlier quoted context omitted.

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

I want to agree with the spirit of what you're saying, but given the potential complexity and uniqueness of a GUI, I think it's an extremely hard problem in practice, if not impossible. You're asking for a toolkit that is both generic enough to provide the common functionality you're describing, yet also comprehensive and flexible enough to cope with the diverse needs of different applications and the diverse convent…

How hard can it be to build a toolkit that supports a textbox on Mac OS X, Windows, and Linux? For a moment I thought you proposed a solution a thread up:

> have it translate into the correct API calls on each platform under the hood.

What if instead of writing controls for applications, the applications had low level access to create controls on their own?

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

#138
post #76

I'm surprised nobody has mentioned Angular 2 yet. It's new, so don't expect tons of support. Nonetheless, it's there as an option!

Probably because you didn't read the OP's explanation of minimum standards that included.

> - I won't use the web. No HTML, no CSS, no Javascript. Sorry.

If you're using HTML, you're already limited in known ways. Conflaguration of logic with presentation and callback hells and limitations of CSS extensions by platform. Then the there's the need to split HTML views due to technical limitations and practicality of maintenance adding a whole new layer of complexity in view and view fragment management!

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

#139

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.

Is it open-source?

What I want is closer to writing my own Xojo.

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

#140

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…

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.

So far wxWidgets is the only library that anybody has mentioned that actually can be counted on to make somewhat accessible UIs. To see it dismissed because it's a little crufty for the developer to work with makes me incredibly sad, as it's just part of the slow decline that leaves me as a blind person with less and less accessible stuff to use. One day I'll be stuck on an old emulated version of Windows running only apps which I have created for myself. What a bleak, shitty future.
Post reply on HN