3 ms·
My one gripe with this article is that it doesn't really explain why a wrapper over native toolkits is untenable. There haven't been many attempts of this idea,
by smasher164 3y ago
My one gripe with this article is that it doesn't really explain why a wrapper over native toolkits is untenable. There haven't been many attempts of this idea, of which wxWidgets and libui are a couple. Yes, it exposes its own complexity, but I would rather start with a GUI that's portable/accessible, and then worry about its look-and-feel.
- ReactiveJelly 3y agoIt really bugs me that native toolkits, and even cross-platform kits like GTK+ or Qt, seem to reject testability. They want you to open a window and build a widget inside the window. The APIs for rendering to a byte buffer and injecting bogus input events seem kinda weak. If I make my own toolkit, I'll focus on that first. I don't want such a huge part of the app to be an untestable I/O leaf.
- throwaway2037 3y agoIn the case of Qt, this is simply untrue. Google "qt gui unit tests" and you will find plenty of content -- from Qt and blog posts with Real World cookbooks and stories. And, Win32 has a whole separate subsystem for unit testing UIs. Read more here: Win32 -> "UI Automation Test Library" Man, there is so much damn misinformation about Qt on HN. It is tiring. I don't understand the source of this misinformation. Part of it probably stems from their various licensing mishaps over the years that seeded a bunch of FUD. It's a ridiculously good cross-platform UI library. KDE would not exist without it! I don't work for them, but I have used the toolkit for years. Nothing beats it. Yes, it is huge, but it does everything you could ever need.
- ReactiveJelly 3y agoI used Qt4 for a few years and never found an easy way to run a widget outside the context of a window. Maybe I didn't check the docs closely, maybe it's better in Qt6. I stopped working on GUIs a while back. Fwiw HTML and xaml were just as bad for that.
- throwaway2037 3y agoIt is unbelievable what people complain about with GUI toolkits. Nothing short of "does not do my homework" seems to be the limit of complaints. Let's get this straight: You want to paint a widget without a normal window border. This is not normal. It would be difficult even using native UI APIs. Also, Qt4 was last released in 2011. That was nearly 12 years ago. Maybe... try again? Also, you can Google: qt widget without window border Plenty of hits.
- scythe 3y agoI think the problem is that nobody wants to do a lot of work to make something that will be basically just good enough for hobby projects. There's no money in it, and side projects "for personal fulfillment" tend to avoid the kind of clerical work that compatibility with several different APIs requires: lots of reading, lots of boilerplate (on the framework end), lots of testing, not much freewheeling design and speculation. Hell, IUP (which supports Windows and Gtk) has gone decades without finding someone outside Brazil to maintain a Cocoa port. It's either professional-grade — very complex and needing a corporate backer — or it's not, and a GUI cross-platform compatibility layer is in the uncanny valley. Maybe someone will figure out how to fund it?
- kitsunesoba 3y agoPart of the problem is that it's hard to build native toolkit wrappers in a way that's "sexy". Cocoa, Win32, GTK, etc are boring old retain mode UIs using boring old patterns which lends to their wrappers being written the same way. Trying to write a React-style wrapper for example is not going to be fun because you're fighting the very nature of what's under the hood.
- srgpqt 3y agoFunnily enough, the web browser DOM is also an old boring retained mode pattern. Hence all the vdom diffing madness React does…
- Klonoar 3y agoI mean... no, it's not that bad. Working around retained-mode UI patterns in declarative UI is a fairly well explored problem. The real issue, in my opinion - as someone who's worked in a litany of UI systems and built my own UI frameworks and libraries: it's a lot of frankly boring as shit work that everyone gets into and then drops like a rock once the dopamine rush of implementing basic widgets wears off. (Then you add on that the number of people who know the big three (Cocoa/Win-whatever-they-use-now/GTK-or-QT) really well is a much smaller pool)