Live data from Hacker News

Writing GUI apps for Windows is painful

tulach.cc

11–20 of 577 posts

Re: Writing GUI apps for Windows is painful

#11

More accurately: + "portable" (single exe with no automatic unzipping of dlls or anything) + commercial and unwilling to redistribute compiled object files (which together with the "portable" requirement, means no LGPL) + dark mode Windows GUI apps is painful. Drop any one of these requirements and there are good established options. Specifically I think most "portable" applications use win32 because, usually, portab…

Anyone can compile a static binary with FLTK and have the binary size start under 100KB.

Re: Writing GUI apps for Windows is painful

#12
Apple and Microsoft underinvest in their widget toolkits. It’s especially damning for Apple since they spend the money to write numerous custom widgets (e.g., the widgets in their professional apps like Final Cut Pro and Logic Pro) but don’t upstream. Nobody is inspired by yet another implementation of button or tab widgets.

Re: Writing GUI apps for Windows is painful

#14
post #6
post #2

Writing GUI apps is painful period, and it’s become more so not less in the last two decades. Go back in an emulator some time and try Visual Studio or even old Borland from the 1990s. Point, click, add code, set style, and the result was not bad at all. The whole UI looked consistent too with uniform controls, shortcuts, etc. Today UI apps use 100X more memory, are slower, and are harder to use with little to show f…

> Today UI apps use 100X more memory, Larger memory footprints aren’t just from the GUI. There is a lot more functionality to deal with everywhere. Just handling modern security, encryption, and certificate checking stack can take up more space than entire executables from the early 90s. I also have literally 100X more RAM now. > are slower, Im fairly certain everyone who says this has simply forgotten how slow mecha…

> Im fairly certain everyone who says this has simply forgotten how slow mechanical hard drives were.

Absolutely, but I would go even further with this. I can't prove it, but I would bet a lot of money that Windows 10+ has made using a spinning disk even slower. I would guess optimizations around disk access were entirely different in the XP era compared to now, when it is assumed everyone has an SSD.

Anyway, I had an old laptop that ran like absolutely dog shit. I put an SSD into it and it magically became usable again.

Re: Writing GUI apps for Windows is painful

#15
post #6
post #2

Writing GUI apps is painful period, and it’s become more so not less in the last two decades. Go back in an emulator some time and try Visual Studio or even old Borland from the 1990s. Point, click, add code, set style, and the result was not bad at all. The whole UI looked consistent too with uniform controls, shortcuts, etc. Today UI apps use 100X more memory, are slower, and are harder to use with little to show f…

> Today UI apps use 100X more memory, Larger memory footprints aren’t just from the GUI. There is a lot more functionality to deal with everywhere. Just handling modern security, encryption, and certificate checking stack can take up more space than entire executables from the early 90s. I also have literally 100X more RAM now. > are slower, Im fairly certain everyone who says this has simply forgotten how slow mecha…

I assume OP means slower on like-for-like hardware, rather than slower when run on a PC from the 90s, but to be fair the WinForms/WPF component of old GUI's was very fast even on legacy hardware.

Re: Writing GUI apps for Windows is painful

#16
post #5
post #4

How about gtk?

I love GTK, but compiling it on non-native platforms is torture. If you're lucky enough to get a build environment working, compilation can take hours just to yield a horribly buggy and slow GUI. I really wish GTK worked better cross-platform, but I mostly use it for Linux-only stuff. It's not humane to make Windows and Mac users suffer through it, unfortunately.

MSYS2. And copy over prebuilt dependencies. And while we say C++, I suggest always to use Meson as build tool. Which allows you to use WrapDB (built in dependency-manager) aside from available native libraries and own local sources.

MSYS2: https://www.msys2.org

Meson: https://mesonbuild.com

The problem about Windows is, that Microsoft adds new APIs repeatingly and doesn’t care much about the previous ones. While on Linux we’ve Gtk1, Gtk2, Gtk3 and Gtk4.

And while people complain about deprecations and changes they actually mean „API changes require work to use the new major. But these people keep maintaining it. And provide upgrade paths to enhanced versions? I’m in!“.

HiDPI, Wayland, new Widgets, new renderers and a scene-graph.

PS: If you need to keep it small and simple and address professional (power) users I suggest a TUI with the venerable ncurses. Or notcurses.

Notcurses: https://github.com/dankamongmen/notcurses.

Demo of Ncurses (For the lulz): https://www.youtube.com/watch?v=dcjkezf1ARY

Re: Writing GUI apps for Windows is painful

#17
post #8
post #3

>As a fellow European, I do not have air conditioning. Is anything stopping the author from buying a heat pump?

Depending on if he lives in a apartment some country/cities have laws against doing any work in the appartment that impacts the outside without permission from the house owner. E.g. you can buy a heatpump but you can't drill the hole in the outer wall. In germany and austria most if not all windows also either open fully to one side or basically bend inwards so you can't install the ac units you install directly into…

Are portable AC units not available in Europe? They are inefficient but can sit inside next to the window and only require that you partially block off a window opening.

Re: Writing GUI apps for Windows is painful

#18
Ooh I remember having a 'Windows API fundamentals' elective at college. I wrote an app with a couple buttons, menu and scrollable text area, but not much in terms of functionality, in pure C, that was all around well-behaved. It was more than a thousand lines.

Re: Writing GUI apps for Windows is painful

#19
This is a good overview of some of the options, but the author’s specific requirements push it in a specific direction that eliminates a lot of options.

Specifically, the requirement for completely custom GUI styling without writing his own render functions means it’s really a task of selecting easy, customizable GUI libraries rather than generic GUI work.

The requirements to be self-contained executables and under a 40MB limit also rule out a lot of options. The author admits that Qt could have met these requirements but the open-source licensing part wasn’t compatible with his goals and he didn’t want to pay for a license.

If you relax the requirements to tolerate some dependencies, allow larger download sizes, or to simply use built-in Windows GUI controls the situation is very different.

For writing a lightweight, completely custom GUI with no external dependencies and permissive licensing I could have guessed ImGui would be the answer before I started reading.

Post reply on HN