Live data from Hacker News

Writing GUI apps for Windows is painful

tulach.cc

171–180 of 577 posts

Re: Writing GUI apps for Windows is painful

#171

Just use WinUI 3. Opting into MSIX packaging no longer requires an App Container sandbox. More info here: https://learn.microsoft.com/en-us/windows/msix/desktop/deskt... Full disclosure: I work at Microsoft.

For >1 minute incremental compile times? No thanks.

[flagged]

Re: Writing GUI apps for Windows is painful

#172

> It would require me to write a custom paint function for every single control, which would take so much time I could raise a family in the meantime This is a weird comment that shows the philosophy of old school win32 has not clicked for them. The key element in win32 is the wndproc. Most controls ask their parent what color they should be via a window message. If you find this inconvenient, wrapping that in a smal…

> Most controls ask their parent what color they should be via a window message.

There are a LARGE number of areas where this is not provided, such as the text color of a disabled control or the checkbox area of a checkbox control. Even for the cases where such customization points were provided, many of them were broken when theming was added in Windows XP and in comctl32.dll version 6 in Vista, which ignores some of them in favor of theme colors or images. Menu colors, for example, are ignored when theming is enabled.

The result is that if you want something approaching a reasonable dark theme with Win32 stock controls, you will often need to resort to full owner-drawing of the controls. This is not a minor task.

Re: Writing GUI apps for Windows is painful

#173

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.

While Apple could stand to improve some aspects of their UI toolkits (and you're right that private widgets have long been a frustration), I'd say they're in an entirely different plane in existence relative to Microsoft in this regard. The most solid of their toolkits is far and away UIKit on iOS. It's got almost all of the best parts of AppKit with over a decade of thoughtful tweaks, polish, and QoL improvements. A…

UIKit is actually nearly 20 years old and AppKit is getting close to 40…

Re: Writing GUI apps for Windows is painful

#174

Earlier quoted context omitted.

I think there is a thing called Microsoft Office development kit or some other name that allows C# and other .Net programs to manipulate Office apps. Not sure if it's what the author meant, though.

Oh, I have used OLE (or some iteration thereof) to drive Excel from Python. That was a long time ago, but it sounds similar. I wasn't really doing GUI, though - I was using code to build spreadsheets from data files.

I had something I wrote in the 90s I wasn't proud of that was a word macro that read Excel sheets for a list of instructions and used those to compose documents and print them. I feel sick thinking about it.

Re: Writing GUI apps for Windows is painful

#175
post #8

Earlier quoted context omitted.

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.

They definitely exist, and are very cheap. I got one for 200, gave away to a friend when I moved out of an attic apartment. They have a window-attachment accessory that makes it easy to attach to those European windows.

The real reason most of us don't have AC is because it's hot for a very short period. Last year it definitely wasn't too hot for me to warrant having one. This year so far, it was, for a week: we had about 30°C (86°F) last week, but next week my mobile phone promises it's gonna be 20°C (68°F) maximum, which does not need AC. Maybe that will change, though.

Re: Writing GUI apps for Windows is painful

#176

Earlier quoted context omitted.

As a mobile dev, it should be the same for mobile apps? If you are on iOS, you could just use what Apple gives you with very little customizations. The app would feel right, dark mode, font sizes, screen traders, etc. accessibility would "just work" 98% of the time, the app would be fast. On Android, things are a tad bit more complicated, but it still applies that the closer you are to the OS, the better things work…

They also often want to use web technologies and/or cross-platform GUI toolkits, to avoid reimplementing their UIs.

And all because they fundamentally believe that their development time and expense is worth way more than their customer’s time and expense.

Re: Writing GUI apps for Windows is painful

#177

Problem: It is extremely hard to stylize native Win32 controls. That's not a problem, it's a feature. I am absolutely bloody sick of apps that go out of their way to reinvent the standard UI controls in perplexing ways and behave unexpectedly. Following the system UI preferences is what you should do, and it irritates your users if you don't. There is a “hidden” dark mode for Win32 controls used by Windows File Explo…

> That's not a problem, it's a feature. 1000 times this. I want software I'm running to look like the rest of the OS (and every other application) and respect my OS-level UI preferences. In the case of Win32 using the OS primitive controls mean that your application gets tons of accessibility and preference features "for free" (albeit Microsoft has done a good job in later Windows releases of removing the functionali…

You seem to be in the minority with that thought.

The evidence is that most apps nowadays comes with their own style, often packed in a HTML frontend.

Users are used of websites which all have their own designs, and don't seem to mind if all apps have different look and feel.

Re: Writing GUI apps for Windows is painful

#178
post #174

Earlier quoted context omitted.

Oh, I have used OLE (or some iteration thereof) to drive Excel from Python. That was a long time ago, but it sounds similar. I wasn't really doing GUI, though - I was using code to build spreadsheets from data files.

I had something I wrote in the 90s I wasn't proud of that was a word macro that read Excel sheets for a list of instructions and used those to compose documents and print them. I feel sick thinking about it.

Reminds me of Moe on the Simpsons saying I've done things I'm not proud of. And the things I am proud of are disgusting.

You should be proud like that.

Re: Writing GUI apps for Windows is painful

#179

For requirements like that, I typically write WPF C# frontend, combined with C++ backend. Compared to ImGui, in WPF you’ll get a GUI designer, styling which allows easy dark mode, data bindings, data templates, animations, IDE support like live visual tree inspector, accessibility support, and more. If you use the legacy .NET 4 framework, the .NET runtime will come pre-installed on modern Windows. If you compile your…

WPF has been superseded (supposedly) by UWP / WinGUI / MAUI / Blazor?

UWP was designed primarily for Windows phones, usability on desktops suffers. And it requires windows store, you can’t just ship an installer .exe

WinUI seems to be copy-pasted from UWP, same usability issues on desktops. Unlike UWP, it’s a mess in terms of software quality. Also the runtime is huge, I think the size in MB even exceeds Electron.

About MAUI, it seems Microsoft decided to make an abstraction over native controls. It’s been tried for decades and it always results in the same suboptimal result because these GUI frameworks implement the least common denominator of available UX. In addition to that, on Windows that thing uses WinUI3 backend, see the previous paragraph.

I don’t know anything about Blazor, but it seems that thing is for web apps?

Re: Writing GUI apps for Windows is painful

#180

Unlike Windows, Apple and Android have managed to publish modern UI libraries for their own platforms - but in both cases, this involved migrating the whole platform to a new programming language (Swift and Kotlin, respectively). If I remember right, C# also has a few features which were only added to make Windows Forms and WPF more ergonomic. I'm starting to suspect that general-purpose languages just aren't flexibl…

Kotlin wasn’t designed with Compose in mind. They shoehorned it via compiler plugin.
Post reply on HN