Live data from Hacker News

Ask HN: How do you create a cross-platform GUI without using Electron?

news.ycombinator.com

101–110 of 112 posts

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#101
post #95

I am making a simple image editor for myself to use on Linux, and honestly? After looking at different bindings for Qt and GTK on Go/Rust/Java and looking at other GUI frameworks (all of which are in beta state, it seems) I went back to Java+JavaFX. There's a decent GUI markup editor (Scene Builder). There's no need to manually connect your handlers from XML markup to code - you can use annotations for that. There's…

UPD: I checked out Graal Native. It was somewhat painful to make JavaFX work with it, due to reflective nature of the framework (which does not work very well with Java Modules), but I managed to make a native image with Gluon plugin for Maven. And it starts up FAST, I like the result.

[0] - https://docs.gluonhq.com/#_gluonfx_plugin_for_maven

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#102
post #27
post #7

There are several options, each with their own pros and cons. Qt [1] The main codebase is C++, but bindings are available for Python and several other languages. I have developed and shipped multiple cross-platorm applications using Qt, using both C++ and Python. Documentation and source code examples are readily available. JUCE [2] Another C++ framework, with Python bindings. The focus is on music and audio apps, bu…

Vote for Flutter and QT

Why is flutter better than electron?

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#104
At my work a few years back, we did quite a lot of prototyping using Qt, QML and JavaScript. It can get you surprisingly far for a GUI. It’s probably not the “right” way to do it, and Qts approach to QML is that it’s for UI. It app logic, but it’ll work in a pinch and it’s pretty easy to pickup.

That said, QML and QtPython sound like a really great combo

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#105

I'd highly suggest using Dart and Flutter. I've probably written GUI apps in C, Java, Ruby, Objective-C, Swift, JavaScript, and probably a couple I forgot about. Dart+Flutter come the closest to being "good" and correct. There's some missing documentation for Desktop development with regards to Flutter + Dart but nothing is totally intractable if you're willing to read through issues. My only caveat is that Google is…

> Qt is probably fine but their licensing turns me off from ever using or considering it.

If I may ask why? They provide GPL and LGPL, and this last one is quite permissive.

See: https://www.qt.io/licensing/open-source-lgpl-obligations

> In case of dynamic linking, it is possible, but not mandatory, to keep application source code proprietary as long as it is “work that uses the library” – typically achieved via dynamic linking of the library. In case of static linking of the library, the application itself may no longer be “work that uses the library” and thus become subject to LGPL. It is recommended to either link dynamically, or provide the application source code to the user under LGPL.

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#106
I've decided to dust off my somewhat rusty Lazarus, GIT and GitHub skills to build a Lazarus application to follow this thread using the HN API hosted by firebase.

You mentioned getting data to a GUI application using the web, this seemed like an ideal small project that could give you a firmer idea of just how Lazarus might fit your needs.

Notes:

I've never done anything like this (https/json) before but I suspect I'll be done in a day or two. Once it works, I'll then focus on getting it to also run in Ubuntu. I don't have a Macintosh, so that's out.

I've GPL 3.0 licensed it.

I'm not near the MVP yet, but it does manage to fetch the data and count the JSON objects in it for the main body of this thread.

With Debug info, the windows executable is 25 megabytes, without it 3.1 megabytes.

Here's the github link: https://github.com/mikewarot/WatchHN

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#108

I'd highly suggest using Dart and Flutter. I've probably written GUI apps in C, Java, Ruby, Objective-C, Swift, JavaScript, and probably a couple I forgot about. Dart+Flutter come the closest to being "good" and correct. There's some missing documentation for Desktop development with regards to Flutter + Dart but nothing is totally intractable if you're willing to read through issues. My only caveat is that Google is…

Doesn't Flutter fail point 1: all widgets are custom rendered (OpenGL) things? So integration with the host OS's capabilities may be lacking (e.g. accessibility features).

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#109
post #74
post #32

Earlier quoted context omitted.

I second this choice. It is the only toolkit that looks native in Windows. And it is ridiculously fast compared to alternatives.

I'm currently writing a cross-platform toolkit, and I'd like to know what native looks like in Windows. As far as I can tell it's worse than Linux. You have the old Win32 / MFC style widgets, and programs like Notepad++ that use something that looks similar. There's the style that much (but not all) of the Control Panel seems to use (is the name Metro?), but the only application that I've used that uses anything simi…

Windows 8 really broke the UI, to support tablets, and the OS has never recovered. :(

Re: Ask HN: How do you create a cross-platform GUI without using Electron?

#110
post #13

It would be really nice if there was a shared widget API that would work for the major operating systems. If most of simple app could work on Windows, OSX, maybe mobile (Android / iOS) and Linux / BSD. Something that was mostly native for all of them. Currently the only alternative to Electron that is similar is a program that hosts a local webserver and the local browser is pointed at it, but that's a second class e…

I think wxWidgets fills this role pretty nicely. It's what, e.g., Audacity and FileZilla use.

My biggest criticism is more that the widgets library really should already _be_ there, and ideally updated automatically, on a client's system.

Hello World (GUI) shouldn't be a 50MB deliverable. If I'm providing someone with a toaster I shouldn't have to ship a whole mobile home. Nor should that end user need to park 300 mobile homes on their hard disk.

There are other criticisms about wxW in specific linked from the wikipedia page... https://en.wikipedia.org/wiki/WxWidgets#Criticism

Dolphin's is illustrative of the pain involved in using that widget set. https://dolphin-emu.org/blog/2017/06/03/dolphin-progress-rep...

Post reply on HN