Live data from Hacker News

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

news.ycombinator.com

61–70 of 112 posts

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

#61

In Solvespace we use native GUI on Windows, MacOS, and Linux (GTK). This is probably not what you want to do, as we don't use any GUI widgets - only popup dialogs and menus. Everything in the app itself is rendered using OpenGL. Even our "text window" is drawn using OpenGL and GNU unifont (this is something that really needs to change BTW). The platform abstraction code is here: https://github.com/solvespace/solvespa…

> our "text window" is drawn using OpenGL and GNU unifont (this is something that really needs to change BTW) What would you change it to? I've implemented a GUI toolkit from scratch a couple times, and text editing was the hardest part by far.

>> What would you change it to? I've implemented a GUI toolkit from scratch a couple times, and text editing was the hardest part by far.

I have no idea. The biggest problem with it now is that it's not resizable. We could use pango or something to render text at different sizes but that'd be a new dependency.

Also forgot: we do use a platform specific text entry widget.

Also2: when I say "we" I mean the previous maintainer did all the cross platform code. Since then it just works.

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

#63
post #47

So just for the sake of completeness, maybe, and since Electron seems to be the most popular solution; what about a website? Fairly ubiquitous across all platforms with the help of Chrome, Firefox, and even Safari or Edge. I don’t think should be dismissed as often as is, consider VS Code on Github.com (hit the period key in a repo and the repo’s code is presented with VS Code in a browser — and it supports syncing e…

I need to read/write to the filesystem, think the app is like a personal document manager. Also will like to associate filetypes with it, and for the most important thing is being able to send notifications and make sure my backend is syncing data all the time

For the record you can do the last two things with a website these days. Still sounds like it won't work for your project, though.

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

#65
This thread doesn't inspire confidence. It's mostly small and unproven projects, some maintained by hobbyists.

I think the mess we're in with GUIs is because we've failed to find a way to convey at a very high level what the inputs and outputs of software are. In a utopian world, you'd define what you want the user to see and how the user can interact with the information. Something would then work out how to lay that for you (in a way that makes sense to a human) and construct a GUI using native OS APIs.

Instead, we have only three options that I'm aware of:

* Use a framework that ignores the native APIs, throws away the OS design language and does all the rendering inside

* Build separate applications for each platform

* Use Electron and potentially reuse work you already did on the web version

When looking at it this way, it's easy to see why Electron is popular. Not that I'm a fan of it in any way.

I think what we need is a lot of really smart people to come together to reinvent the presentation layer.

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

#66
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…

Is there a good grid control (ie a data grid) for Blazor? A colleague reviewed the offering from Infragistics and it wasn't anywhere near their WPF data grid control.

There are grid controls from the usual commercial vendors like Radzen and Telerik. I used them briefly during a free trial. It has a funny name, but MudBlazor [1] has been the MIT licensed library I have been using lately. I have been using their Table control, which may be what you are looking for in a data grid. [2] Check it out and see.

[1] https://mudblazor.com/

[2] https://mudblazor.com/components/table#api

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

#67

One word: Lazarus. Cross platform done right (native code, no intepreter, no VM). Both IDE and generated code run native just about everywhere, from small ARM boards to virtual machines, and of course x86. As fast as C, decent sized executables, lots of built in or available libraries and components to do a lot of things, from managing databases to low level access to hardware, graphics, sound, etc. And of course it'…

For your limited use case, ffmpeg / VLC wrapped in a small .sh or .bat script may have been an option?

VLC can understand ONVIF RTSP and tile the video's into a mosaic

https://www.youtube.com/watch?v=qV-S4LMePVk

https://wiki.videolan.org/VLC_HowTo/Make_a_mosaic/

Id love to try lazarus one day all the same

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

#68

https://tauri.studio/ - I haven’t used it myself but looks pretty interesting. They say they use existing browser engine shipped with OS and desktop integration layer written in Rust. The claim is that you get an application size under 1MB

Interesting, but say good by to consistency across platforms.

The whole reason electron was created is because using a random unknown browser on the OS has random results.

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

#69

Java and Swing are still a great option.

Java has a few options...

AWT (Abstract Windowing Toolkit) probably not recommended for new projects

Swing

JavaFX

SWT https://www.eclipse.org/swt/ Unlike the others that draw their own widgets and don't use the OS components SWT uses the native platform controls

Post reply on HN