Live data from Hacker News

Cross-Platform GUI Toolkit Trainwreck (2016)

blog.johnnovak.net

121–130 of 177 posts

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#121
post #120

I know the author focused on Nim, but I wonder how Lazarus (or Delphi I guess) would fare. Sadly it's FreePascal, but it really does look like the less bullshit platform to make cross-platform desktop applications.

Delphi was, and Lazarus is, amazingly well designed. Lazarus comes pretty close to a Swiss army GUI tool, and once you get to know it a little better, Object Pascal is actually a very nice language that rivals C++ (!) in power. It's still my secret weapon at work. If only the docs were better. Still keeping around a VM with Delphi 7 from 1999 just because documentation was sooo good then.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#122

So many sub-debates hidden in this "cross-platform native GUI": 1) I want to write a GUI code once 2) I want to ship something that works on Windows / Linux / MacOS 2.1) I want to ship something that looks the same on Windows / Linux / MacOS 3) I want to ship a binary that works on Windows, a binary that works on Linux, a binary that works 3.1) I want to ship a small and efficient binary 4) I want to ship something t…

> 2.1) I want to ship something that looks the same on Windows / Linux / MacOS Why? I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements. (There is no one native Linux UI, so we can leave that one aside...)

Because someone gave the brand team authority and they can't have their brand take second place to Microsoft's or Apple's.

Branding teams are in my experience very picky about lots of stuff. For example, my employer's brand design team recently released a rule that when our logo is included alongside others logos in a list of companies involved in a partnership, it may not be included in a vertical list, only a horizontal list.

Using the standard background colour for the platform on your app when it's not one of the brand design team approved colours? Also out.

etc. etc.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#123

So many sub-debates hidden in this "cross-platform native GUI": 1) I want to write a GUI code once 2) I want to ship something that works on Windows / Linux / MacOS 2.1) I want to ship something that looks the same on Windows / Linux / MacOS 3) I want to ship a binary that works on Windows, a binary that works on Linux, a binary that works 3.1) I want to ship a small and efficient binary 4) I want to ship something t…

> 2.1) I want to ship something that looks the same on Windows / Linux / MacOS Why? I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements. (There is no one native Linux UI, so we can leave that one aside...)

I maybe biased after doing web work for toi long, but "hey, the site does not look the same in safari than on edge" has occupied a lot of my time.

It's a common concern to avoid confusing users who switch OS often (eg when demoing on someone else's machine.)

The fact that it contradicts the other requirement ("but it does not look like the other apps") is lost on no one.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#124

So many sub-debates hidden in this "cross-platform native GUI": 1) I want to write a GUI code once 2) I want to ship something that works on Windows / Linux / MacOS 2.1) I want to ship something that looks the same on Windows / Linux / MacOS 3) I want to ship a binary that works on Windows, a binary that works on Linux, a binary that works 3.1) I want to ship a small and efficient binary 4) I want to ship something t…

> 2.1) I want to ship something that looks the same on Windows / Linux / MacOS Why? I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements. (There is no one native Linux UI, so we can leave that one aside...)

The only valid case for this (IMO) is really expensive professional apps. Where someone is going to spend years getting really, really good at using a piece of software, and you want them to be able to just use it the same way regardless of platform. And you especially don't want people to have to re-learn how to use your really complicated software if the host OS changes how scroll bars appear or the position of window chrome.

But I suspect lots of software companies would think that describes them, when in reality there's probably fewer than 10 products that meet that bar.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#125
post #43

Earlier quoted context omitted.

Shameless plug: https://github.com/AshampooSystems/boden We are working on providing exactly that thin native wrapper in modern C++ without much bloat.

Do you guys plan on supporting desktop apps or are you sticking with mobile?

For the first release we are sticking with Mobile, but Desktop is "next on the list". ( And there is rudimentary macOS support right now )

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#126

So many sub-debates hidden in this "cross-platform native GUI": 1) I want to write a GUI code once 2) I want to ship something that works on Windows / Linux / MacOS 2.1) I want to ship something that looks the same on Windows / Linux / MacOS 3) I want to ship a binary that works on Windows, a binary that works on Linux, a binary that works 3.1) I want to ship a small and efficient binary 4) I want to ship something t…

ReactXP (https://microsoft.github.io/reactxp/) targets mobile and desktop platforms using the OS's native UI.

Windows support is implemented via https://github.com/Microsoft/react-native-windows and targets W10, Xbox, and Windows Mixed Reality.

MacOS support is experimental, but mostly working. Linux currently needs an Electron wrapper. Theoretically you could port one of the react-native-desktop projects to use GTK or Qt.

Then of course you have native iOS and Android components with Facebook's ReactNative and web support via React.

ReactXP wraps all of these projects allowing you to write React components and TypeScript code that is shared among every platform. It's the same workflow as Electron, even less so, with native UI.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#127

Earlier quoted context omitted.

I have the same question. There are many things that are problematic about Qt (personally, I loathe anything that feels the need to interject itself in the middle of the build process) but to completely ignore Qt without explanation - and subsequently post detailed experiences with libraries I've never even heard of - led me to believe the author exists in some uninteresting-to-me parallel plane of existence.

You mentioned it but, the strange meta object macro processing that qt depends up on, has been something I dislike. If I remember correctly GTK or other toolkits does not do anything similar. And qt python bindings seems to be very poorly documented, same case with Java bindings.

The Java bindings for Qt are also horribly out of date. This has killled off my largest OSS project to date, just before it was starting to become decent.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#128

So many sub-debates hidden in this "cross-platform native GUI": 1) I want to write a GUI code once 2) I want to ship something that works on Windows / Linux / MacOS 2.1) I want to ship something that looks the same on Windows / Linux / MacOS 3) I want to ship a binary that works on Windows, a binary that works on Linux, a binary that works 3.1) I want to ship a small and efficient binary 4) I want to ship something t…

> 2.1) I want to ship something that looks the same on Windows / Linux / MacOS Why? I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements. (There is no one native Linux UI, so we can leave that one aside...)

This is less fashionable now in the era of Electron apps - users are starting to expect apps that look _the same_ everywhere.

See VSCode, Discord, Spotify...

It's easier to get a single code-base that 'just works' across platforms if you have an abstraction that is truly cross-platform. One of the major value propositions of developing with Electron is this ability to develop cross-platform 'with confidence' - I can build an app on Windows and be 99% sure it's going to look function the same on OSX / Linux.

> I want my macOS apps to use Mac-native UI elements, and Windows apps to use Windows-native UI elements

That's a fine goal but it means you end up needing more platform-specific code. It's a trade-off, and there isn't a one-size-fits-all solution.

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#129
post #45

I think he got it wrong when he quickly ruled out IMGUI, as you can use it to create a small app with next to no dependencies. He complains that you need to redraw your GUI at 60 FPS, but this is wrong, you should be able to draw with it only when needed. I am a big fan of Nuklear. I can write a tiny C app that compiles on macOS, Windows, iOS, and Android with it. The look and feel of Nuklear can be something you don…

> He complains that you need to redraw your GUI at 60 FPS, but this is wrong, you should be able to draw with it only when needed. Yep, he did that, as stated here from TFA: > The solution was to redraw only when needed: as a quick hack I introduced a global boolean doRedraw and set it to true only when an input event was received or the internal application state had been changed (e.g. the framebuffer had been updat…

He speaks about the 60 FPS when he tried NanoVG... I think he did not realize he could do that trick with IMGUI. For text rendering with Nuklear, you make a font atlas from a true type font, rasterizing the font is built in Nuklear with stb_truetype. That gives you a lot of freedom. You can load as many fonts as you need. There is also support to load a binary resource such as the TTF file from a base85 string; it's very handy. For layout it's immediate mode, so you describe it with code such as

nk_layout_row_dynamic(ctx, (float) row_height, 3); // a row of 3 buttons if (nk_button_label(ctx, "Previous")) ... if (nk_button_label(ctx, "Next")) ...

Here is small app I made with Nuklear: https://www.youtube.com/watch?v=MycIYcutlMA

Re: Cross-Platform GUI Toolkit Trainwreck (2016)

#130
post #90

Earlier quoted context omitted.

> He jokingly mentions Qt in the caption of the final picture. well, he can keep joking and I can keep shipping Qt apps and everyone's happy

Except your users, they end up with your MBs.

I ship a Qt app. The installer is 135MB. 90MB of that is a demo video that comes with it. Nobody has ever complained.
Post reply on HN