3 ms·
Anyone can compile a static binary with FLTK and have the binary size start under 100KB.
by CyberDildonics 2y ago
Anyone can compile a static binary with FLTK and have the binary size start under 100KB.
- criddell 2y agoYou 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.
- CyberDildonics 2y agoI 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.
- throwaway2037 2y agoI'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.
- triedthat 2y agoI'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/c6f630eaa320bce90d6d9096b0718166f0618e32/src/Controls/Input/Input.cpp#L11-L13 https://github.com/gammasoft71/Examples_FLTK/blob/c6f630eaa3...
- moal 2y agoYou 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 https://github.com/MoAlyousef/FLMH This uses a std::function for the captures but you can use a function pointer as well.
- fuzztester 2y agoOr 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.