Live data from Hacker News

Writing GUI apps for Windows is painful

tulach.cc

481–490 of 577 posts

Re: Writing GUI apps for Windows is painful

#481

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.

No idea about Apple, but I'd strongly disagree for Microsoft. In one way of speaking, they invest too much. WinUI3, like the article mentions has such a sordid history. It started as WPF, and WPF was (is) awesome. It's simple, clean, runs on a bunch of different platforms, doesn't have a zillion dependencies, has a great community, and is just all around pleasant to work with. So naturally Microsoft decided to comple…

> And WinUI3 has also already been completely abandoned.

I'm not sure where you got that impression, but WinUI3 is in almost all of Microsoft's software at this point. Admittedly a huge amount of it is embedded inside React Native, but WinUI3 seems to be the UI toolkit that has won and is still going strong. They announced a bunch of WinUI3 enhancements at BUILD even.

(One such announcement is a coming standard control for the sort of custom Windows Title Bar with a search box and branded logo and extra buttons that has become common in every first-party application from the Microsoft Store app to all of Office and many other places.)

> Contrary to this article, it still doesn't even have a visual designer.

Huh? Visual Studio has a visual designer for the WinUI 3 flavor of XAML. If you don't want to write XAML to back your UI they probably will never support a Visual Designer for you (ie, C# UI seems neat and maybe a bit more "functional programming", but I'd rather use XAML just to have the Visual Designer at least). Last I checked the XAML designer works just fine even in C++ projects targeting WinUI 3.

Re: Writing GUI apps for Windows is painful

#483
post #409
post #278

Earlier quoted context omitted.

Agree. "Single executable" combined with "less than 40mb" is just looking for trouble for what the author is trying to do. If you want to do win32, go ahead and give up styling. Otherwise, make compromises. I think many of these are excellent choices chosen by many programs that I use, it's the author's stringent requirements and unrealistic expectations that is holding back.

Winamp comes to mind as a counter example.

IMO, every media player since Winamp 2.x has been largely a step _backwards_ in pretty much every metric one could put forth. It was light-weight, using minimal CPU & RAM. It was skinable. It was reliable. It had great plugin support. I don't recall it leaking memory, either. I basically had it set to auto run on login on my PC. I never closed it. Didn't need to. I had _only_ 32MB of RAM on that computer.

Re: Writing GUI apps for Windows is painful

#484

Earlier quoted context omitted.

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

I've used FLTK for an application. It relies heavily on opaque pointers and convention. The compiler will not help you out if you mess up. https://github.com/gammasoft71/Examples_FLTK/blob/c6f630eaa3...

You can use dynamic_cast instead of reinterpret_cast. If the pointer isn't correct it would return null. A better solution is to subclass the widget, store a function pointer for the callback which takes the same class instead of an Fl_Widget, and call that in the callback: https://github.com/MoAlyousef/FLMH This uses a std::function for the captures but you can use a function pointer as well.

Re: Writing GUI apps for Windows is painful

#485
>WinUI

>modern Windows components

I swear to God if I ever downloaded a piece of open source software from GitHub, opened it, and saw the deformed Windows 8 Metro UI gawping back at me, I would do everything in my power to wipe the blighted individual responsible from the face of the fucking Earth

Re: Writing GUI apps for Windows is painful

#486
post #414

Earlier quoted context omitted.

You're right. I didn't see the Small Business tab when I was quickly looking through it. Still ends up being a blocker when you're not sure how many copies of the product you'll sell.

I guess that is just one of the many risks you have to take if your trying to build a business. A couple of hundred dollars in licensing fees are not going to sink your product. For a side project that you don't expect to make any money it might be too much, but in that case you could just as well open source the project.

It's also worth considering that the value of this license is very likely not a net loss even if your initial product doesn't work out.

Re: Writing GUI apps for Windows is painful

#487

> Writing the GUI part of the program should not take more time than the actual functionality That's rarely a reasonable expectation. Good usability is hard work. > I figured out that for simple apps there is simply nothing better suited than Dear ImGui. If you hate your users, sure. For anything more than a toy please use a real GUI framework.

> If you hate your users, sure. For anything more than a toy please use a real GUI framework.

Do you have any actual real criticism?

Re: Writing GUI apps for Windows is painful

#488
post #428

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…

> he didn't want to pay for a license Well that's the killer right there. I too think it's way too painful to write Windows UI, especially if you want to stay away from Electron (which you should in almost all cases), but refusing to pay money for good software is going to severely hamper your goals in 99% of cases.

> stay away from Electron

Is this really still true though? VS Code and Slack are all quite polished and give me no issues as a user. Not sure what else I'd consider to build something similar.

Re: Writing GUI apps for Windows is painful

#489
> Writing the GUI part of the program should not take more time than the actual functionality

I can't stand this mentality. The GUI is your functionality. The rest as far as the user is concerned may as well be pixies and fairy dust. Treating UI as an afterthought is why we've ended up with so much nightmarish crap these days.

Re: Writing GUI apps for Windows is painful

#490
I'm a fan of a self hosted web service bound only to localhost, then you serve a HTML with all the bells and whistles from that web service. I think they used to call it OWIN. I guess the major downside is that you might get a localhost cert warning if you don't install a self-signed cert and a root cert in the PC's cert store (which yes, yikes)
Post reply on HN