Re:Writing GUI apps for Windows is painful
by CyberDildonics on Sunday June 30, 2024 @03:25PM
(#40839488)
Anyone can compile a static binary with FLTK and have the binary size start under 100KB.
[ Parent
| on HN ]
You can do that with straight win32 as well. Steve Gibson has a bunch of utilities and most of them are pretty tiny. His DNS Benchmark is one of the larger utilities at 169k.
Re:Writing GUI apps for Windows is painful
by CyberDildonics on Sunday June 30, 2024 @05:10PM
(#40840409)
I like win32 and you can get a lot smaller with win32, but there are a lot of things missing. FLTK has a lot of components, component layouts, fonts, file system stuff, networking, audio, an openGL context, image loading and it's cross platform.
Re:Writing GUI apps for Windows is painful
by throwaway2037 on Monday July 01, 2024 @01:42AM
(#40842877)
I'm confused. What is "missing" from Win32? To be clear, I count all base DLLs included with Windows a "Win32". One thing I can think of from your list: component layouts. Resizable windows with component layout is awful in Win32.
Re:Writing GUI apps for Windows is painful
by triedthat on Sunday June 30, 2024 @05:19PM
(#40840481)
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
by fuzztester on Monday July 01, 2024 @05:16AM
(#40843978)
Or with Lazarus, I've tested it a year or so back. Under 50KB, IIRC, for a CLI Hello world app, though, not a GUI one. Similar size with a D app.