Live data from Hacker News

Writing GUI apps for Windows is painful

tulach.cc

91–100 of 577 posts

Re: Writing GUI apps for Windows is painful

#91
post #74

I'm teaching myself the Win32 API for a future RE project, thinking that knowing it helps with the reverse engineering effort. I have just achieved creating a window, loading a text file and printing it on the main window. Scrollbars are there but don't work yet. It actually take s a lot of work. The boilerplate code is OK but I never realized that showing strings on Windows is such a PIA. I have deep respect for any…

IIRC WinG was basically a way to set up a GDI device context that corresponded to a frame buffer, so you could take your DOS SuperVGA code and run it under Windows, only redoing sound and input. It's been almost 30 years though. :)

Yeah that's probably what it was back in the day. I recalled games run pretty slowly on Windows before WinG came out. Fury3 looked pretty slick, even in today.

Re: Writing GUI apps for Windows is painful

#92

I'm working on a GUI toolkit that should match the requirements: Slint - https://slint.dev Can be compiled statically in a single .exe that is smaller than 40M. Has a license that allow proprietary on desktop for free. Has dark/light styles. Even comes with a (work in progress) drag and drop WYSISYG editor.

> Can be compiled statically in a single .exe that is smaller than 40M. That's... quite a high bar. Last I checked even a QML app was only like 20 MB. Why so big?

40MB was the criteria coming from the article. But it's much smaller than that. I don't have the exact number in mind. I'd say much less than 20MB.

Re: Writing GUI apps for Windows is painful

#93
post #27

Writing GUI apps is painful everywhere, and has been for years. I remember the half-baked transition from Windows Forms to WPF, which was then taken-over by the Windows Phone initiative, which was also extremely painful and half-baked. There's a reason electron is so popular, despite all the complaints about it as a platform. Don't blame the electron devs, blame Microsoft for completely failing to support their own p…

> Writing GUI apps is painful everywhere, and has been for years.

I think UIKit and SwiftUI (and to a lesser extent Appkit) are great

Re: Writing GUI apps for Windows is painful

#94
The amount of bloat everywhere today is simply disgusting; just because my group server has 1 TB of RAM isn't a justification for letting a "hello world" app grow to more than 50 kB, GUI or not.

Yes, productivity is more important than squeezing out the last bit nowadays, but that the poster couldn't get his 40 MB limit satisfied shames the whole software industry. He should get a simple (i.e., half a dozen menus, dialogs, windows) GUI app done in 400 kB (it was possible in the past).

Re: Writing GUI apps for Windows is painful

#95

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…

As a non-Windows user, I'm confused, maybe you can clarify:

> If you use the regular Win32 controls then they will automatically get the styling the user has set.

Does that mean they'll get dark mode if the system is in dark mode?

In which case I don't understand what the author is complaining about. Sounds like dark mode would be working as intended.

They want "easy styling" but I took that to mean things like icons, some colors, etc. Not totally replacing what buttons look like. I agree -- being consistent with the OS is a good thing.

Re: Writing GUI apps for Windows is painful

#96
post #31

Earlier quoted context omitted.

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 are but not as efficient and so most people don't bother(that I know of).

Works just fine, I have 8000 BTU and it cools a living room very efficiently. I need it about one or two weeks per year in Finland. I can't imagine anybody working from home without one, even as north as Finland. Although we Finns are probably least used to heat so even 27 celsius is unbearable.

The only thing one needs is a window-sized cardboard with a round hole and blanket if your target room has no door. I just looked at prices and 10000BTU seemed to be ~350 euros.

Re: Writing GUI apps for Windows is painful

#97
post #3

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

As an European from Spain, in south European countries air conditioners are essential(Greece, Spain, South Italy, South Spain, inner Portugal). But in other countries or places it is not really necessary(north of Spain, France, UK, Germany).

Some days of Summer it is hot there, and they are not prepared for that like people of the South of Italy or Spain, and there is chaos.

It is like when it snows heavily in Madrid: https://en.wikipedia.org/wiki/Storm_Filomena In places like Austria or Switzerland it would be routine. They are prepared and it would be not a big deal, but in Madrid it stopped everything for two weeks.

Re: Writing GUI apps for Windows is painful

#98

Earlier quoted context omitted.

Do you mean Visual Basic for Applications? How are you creating a GUI in Excel?

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.

Re: Writing GUI apps for Windows is painful

#99
post #24

Windows (MS) and OSX (Apple) need to agree on a GUI interoperability API. Either hammer something out, or adopt one/more of the OSS GUI framework specifications from QT and GTK. It MUST be open spec. It MUST be free for all/any to implement. It MUST either be included or be in the primary vendor (MS, Apple, distro) software center. A simple Hello World, click OK to exit the program application should be able to be cr…

> need to agree on a GUI interoperability I hope they don’t. I like that the different platforms I use feel and look different. In fact, I wish there was more variety. I wish there were still Atari, and Amiga, and BeOS, Tandy, and all the other interesting platforms competing for users with different ideas of how computers should work.

[deleted]

Re: Writing GUI apps for Windows is painful

#100

I'm teaching myself the Win32 API for a future RE project, thinking that knowing it helps with the reverse engineering effort. I have just achieved creating a window, loading a text file and printing it on the main window. Scrollbars are there but don't work yet. It actually take s a lot of work. The boilerplate code is OK but I never realized that showing strings on Windows is such a PIA. I have deep respect for any…

I have just achieved creating a window, loading a text file and printing it on the main window. Scrollbars are there but don't work yet.

You could just use the standard Edit control for that. If you really want to do it manually, which I have done, it's less than ~300 lines of code for the whole app (including working scrollbars). The binary is less than 4k.

but I never realized that showing strings on Windows is such a PIA.

Are ExtTextOut and related functions all that hard to use? How much simpler do you think it could be?

Post reply on HN