8 ms·
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. Specif
by Aurornis 2y ago
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 40MB limit also rule out a lot of options. The author admits that Qt could have met these requirements but the open-source licensing part wasn’t compatible with his goals and he didn’t want to pay for a license.
If you relax the requirements to tolerate some dependencies, allow larger download sizes, or to simply use built-in Windows GUI controls the situation is very different.
For writing a lightweight, completely custom GUI with no external dependencies and permissive licensing I could have guessed ImGui would be the answer before I started reading.
- chipdart 2y ago> 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. The blogger sounds like they put up a bunch of arbitrary constraints that in normal circumstances wouldn't even be issues. In the process it's those arbitrary whimsical choices that reject the very obvious choices along with any happy path. For example, it's baffling that there are already a few FLOSS forks of Qt out there, but the blogger failed to cover them. If the author likes Qt so much, those would supposedly be the obvious choices. But no. Once again, you are left out of options if you go out of your way to avoid each and any option.
- Shorel 2y agoIsn't the issue with Qt exactly what the GPL intended? In that case, any Qt fork would force him to also comply with the GPL, and supply the source code of his project.
- chipdart 2y agoCopperSpice is LGPL, not GPL. It's not a problem.
- alok-g 2y agoHmm. How could that be when it's based on Qt?
- Liquid_Fire 2y agoQt is also available under the LGPL. There is no license advantage to using CopperSpice. I'm not sure what GP is referring to.
- alok-g 2y agoSome parts of Qt are GPL only.
- Liquid_Fire 2y agoTrue, but they are optional and are not the parts you need to create a GUI as per the requirements in the OP. I assume CopperSpice does not include these components.
- deutschepost 2y agoLGPL. Which eliminates his requirement for a single executable. With LGPL you are only allowed to link dynamically.
- jjmarr 2y agoThe goal of this is so that end-users can modify or update Qt, the LGPL licensed component. The LGPL is working as intended.
- deutschepost 2y agoYes. But the article states that they don’t care about that. They just want a single executable.
- EasyMark 2y agoI never understood the need for a single executable on windows when folders, zip files, and 100% free installers exist if you don’t like zip files. Also nearly all of the gui kits he’s shooting down have ways to build custom components if that’s what you want to do.
- ranger_danger 2y agoNo need for an installer when it's just one file you can run anywhere. And folders/zips are way too hard for the average user. Ask me how I know. My partner gave up an entire game platform because it was delivered as a .7z file they could not figure out.
- elpocko 2y agoDear ImGui is for development/debug tools, not an UI for the end-user. It's great for small projects as long as you don't care about accessibility, or proper keyboard support, or adherence to standard UI conventions, or support for devices without GPUs, proper font rendering, etc. ...
- bun_terminator 2y agoimgui offers incredible development speed. And I've used it many times with great success. It's unorthodox yes (and there's a long-open bug I won't talk about again) but it's dear to my heart. It's like MFC on steroids: You don't have to leave C++. But yeah at least a few of those caveats remain. Although keyboard navigation and font rendering have quite a bit of support.
- fuzztester 2y agoDue to what reasons does imgui offer incredible development speed?
- bun_terminator 2y agoBecause adding a text is just a imgui::text("abc") function call. And a button is just an if(imgui::button("click me")) do_something() statement. There is no other language involved, no markup, no gui editor. Just direct code and highly hackable to make this extend to unexpected lengths.
- fuzztester 2y agoThanks, got it.
- masfoobar 2y agoTo add to this, I find it easier to have a simple while loop that renders the screen, fetching variable data on-the-fly, etc. It is rather pleasing to the eye to understand the layout with IM interfaces, etc. Comparing this to (something like) WPF, you create XAML files, with either or combination of ViewModels and back-end code to "bind" and can get complicated quickly. I guess the only exception to this is if you have commited to WPF non-stop for many months. However, with IM interfaces, its easy to get going (imo)
- eschaton 2y agoIf instead of insisting on custom UI styling the author just used the system UI, they could probably build a pretty straightforward Windows application. It’s the scourge of “brand identity” that has people thinking graphical applications are hard. Same on the Mac: If you want to build a Mac application, your best bet will be AppKit or SwiftUI and using system controls. And when the OS updates your application will either update with it, or need only minor tweaks and a rebuild to look good.
- barrkel 2y agoThis indeed. Custom UI widgets for Windows apps are really not necessary most of the time, and fitting in with the system theme is all you ought to aim for, most of the time. There are exceptions, for very rich dense UI, for UIs that need to be cross-platform, but if you're writing a Windows app, it should look and feel like a Windows app.
- therein 2y ago> and fitting in with the system theme is all you ought to aim for, most of the time Even Microsoft struggles with that.
- pc86 2y agoOnly because they change the system theme every 45 minutes.
- ToucanLoucan 2y agoSeriously, someone needs to reign in their UI department. No more refreshes until you actually finish one.
- klabb3 2y ago> There are exceptions, for very rich dense UI, for UIs that need to be cross-platform That’s not exceptional at all. That’s completely normal requirements that are probably in the majority. Does Microsoft themselves build their apps this way?
- dokka 2y agoYeah, I can confirm that writing windows GUI apps is not at all painful for me. I still use Windows Forms in .NET 4.8 and my executables are < 1mb, Visual Studio's form designer is very easy to use, you can subclass all the .NET UI controls and customize them however you want. There's always been accessibility and even support for high DPI.
- fuzztester 2y ago>I still use Windows Forms in .NET 4.8 and my executables are < 1mb Do you need to ship any supporting files separately, along with the app? And is .NET 4.8 or higher already on Windows PCs?
- throwaway2037 2y ago.NET 4.8 is default in Win10/11 now.
- EnigmaFlare 2y agoA nice thing about .Net Framework 4.8 is that they finally finished it! No more update treadmill and dicking around dealing with what versions are installed or how to configure your application to use whatever different versions. Just target that and forget about it.
- WorldMaker 2y ago.NET 4.8 is the last .NET to be bundled with Windows. It's a legacy stack, but it exists on every Windows >= 10 so it is a legacy stack that makes deployables easy (just assume it is installed). (.NET 4.8 is the new VB6.) With .NET 9 right around the corner, how far behind the legacy stack is only increases. .NET > 5 will never be installed out of the box on Windows PCs. The trade offs to that concession however are: cross-platform support, better container support, easier side-by-side installs support ("portable" installs). .NET > 7 can do an admirable job AOT compiling single-file applications. For a GUI app you probably aren't going to easily get that single-file < 40MBs yet today, but it's going to be truly self-contained and generally don't need a lot of specific OSes or things installed at the OS level. Each recent version of .NET has been working to improve its single-file publishing and there may be advances to come.
- EasyMark 2y agoIf you’re on windows and want a “standard” guy, either use the .net GUI or Qt , if you want completely custom and willing to do the work use QML or ImGui (or variant like eGUI)
- smackeyacky 2y agoWhich particular .NET Gui? There is a collection of them: MAUI, WPF, Blazor Hybrid, WinUI. Microsoft have utterly screwed the pooch on getting their .NET GUI story straight.
- jen20 2y agoProbably Windows.Forms unless there’s a REALLY good reason to do anything else.
- ivm 2y agoWinUI 3 is the default for Windows-only applications
- LordDragonfang 2y agoExcept it's still missing a lot of controls, further development and bug fixes are practically at a standstill, and despite what TFA says, there is no visual designer support (which is a dealbreaker for many multidisciplinary teams). As someone currently involved in switching our app from MFC, I really want to like MFC, but Microsoft's absolutely addled management of the whole thing is making it really difficult.
- deleted 2y ago[deleted]
- pjmlp 2y agoNah, it is so bad, that on BUILD 2024, they have brought back first level status to WPF. No one burned with WinRT history since Windows 8, is ever touching WinUI, unless they are Microsoft employees on WinDev, or companies with sunken costs trying to keep their products around.
- wkat4242 2y agoQt makes such amazing apps. I love KDE and the apps they spawned like Kate, KDEnlive, Krita.. It's no wonder their apps are so popular on Linux and windows alike. Unlike GTK apps even though it does have bindings for Windows.
- rty32 2y agoAgree. "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.
- beagle3 2y agoThis comment makes me feel like I live on a different planet. In 1999, I built a completely custom Win32 GUI for a (brandable) chat application - that was the product the company I worked for was selling. Pure C and C++. It was a 32-bit app, not 64 bits. And we felt bad for it being 250KB single executable (skin included in resource section) and not “150KB or less” as was our initial target. But making it accessible and fully skinnable/themable/l10n/i18n did add quite a bit which we hadn’t realized when thinking 150KB was realistic. But it’s not like we resorted to any crazy tricks; that was just the stripped linker output. It was still a reasonable download at the dominant dial up internet at the time (28.8Kbps IIRC) Sure, modern tools add a lot of cruft that you’d have to work hard to reduce, but 40MB. Oh man.
- rfoo 2y ago> but 40MB. Oh man. It is perfectly fine to build a 150KB or less executable today. But then OP decided they don't want to write paint functions for custom GUI and insist on finding a library to do so, I guess that's not what you did in 1999, right?
- beagle3 2y agoI actually used FLTK for the first iteration; The theming support it had at the time was not sufficient, though, and the i18n story non existent (that was before even 1.0, versions were still labeled by dates). So, because pervasive theming/branding was a hard requirement, and i18n a softer one (every skin has to only support one locale), i had to abandon FLTK. But FLTK did spoil me by providing seamless flicker free double buffering out of the box, which I insisted on implementing in our gui. For those of you who don’t remember - Win32 flickered badly on almost all screen updates, window resizes, etc — I think that was generally true of most apps until 2010 or so. FLTK was essentially the only GUI toolkit at the time (1999) that had no flicker out of the box.
- jocoda 2y agoTitle is "Writing GUI apps for windows is painful", and then the author slaps on a bunch of bullshit constraints but pretends to be covering the general case. Sorry dude, if you want to do that then change the title to something appropriate like "Writing small, custom styled GUI apps for windows is painful". Otherwise this is bait and switch. Implicit (for me anyway) in the title is that you are talking about vanilla GUI apps. Writing vanilla Windows GUI Apps is trivial and there are a bunch of tools that handle this extremely well. The article covers many of them but chooses to disqualify them for reasons. Then we have ImGui as the tool of choice, but now this is qualified as only for "simple apps". Really? After all the fuss about constraints not being met? A bit of cognitive dissonance here I think. More complex functionality things can get difficult but often even these are handled depending on the tools. For vanilla dev the clear winner in terms of productivity has to be WinForms. Or if you can live with the clunky IDE - Lazarus. (You're allowed to replace with your own favorites.) The real challenge is not writing GUI apps for windows, but rather is in writing cross platform apps.
- cratermoon 2y ago"Writing small, custom styled GUI apps for windows is painful" I'd add "for free because I'm too cheap to buy a license for a toolkit that does what I want".
- ClumsyPilot 2y agoAgreed, this is a bit like writing ‘developing iPhone app is painful’ but not using anny officially supported tooling. fact that you must ship the app Unpackaged is particularly strange.
- daemin 2y agoAre you saying without an installer, or unpackaged as in without a package identity ala https://learn.microsoft.com/en-us/windows/apps/get-started/intro-pack-dep-proc#packaged-or-unpackaged https://learn.microsoft.com/en-us/windows/apps/get-started/i... ?
- pc86 2y ago> 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.
- throw__away7391 2y ago> 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.
- naitgacem 2y agoI might understand polished, but no issues sounds odd. What about the abysmal performance? Also most folks building things do not have the resources that Microsoft has, so I believe VSCode is not a good represantative of most Electron software.
- spintin 2y ago[dead]
- PaulHoule 2y agoI've gone through the same process of evaluating x-platform alternatives and I can now understand why Electron is so popular. I mean, you do have the unreasonable bundle size, but other than that you can make really good looking applications using the same tools you can use to make web sites for both desktop and mobile.
- mst 2y agoI've been eyeing https://neutralino.js.org/ https://neutralino.js.org/ since if I'm going to make the app render right on browsers then relying on the same code via webviews likely isn't (much) more portability effort.
- slaymaker1907 2y ago40MB seems like a weird requirement. If it’s under 1GB, I don’t think most people really care any more about executable size. Memory usage is still relevant, but 1GB is going to be less than 1% of disk usage for almost everyone.
- dgellow 2y ago1GB for each app accumulates really quickly. 40MB is really low, but I wouldn’t be happy with 1GB per app personally. Anything below 500-600MB is fine. I want my disk space for large medias, not for a desktop app