I work with a cross-platform toolkit called wxWidgets. The idea is that the wxWidgets classes are all wrappers around real platform-native widgets, so that you can program with a “wxButton” and it is implemented on Mac as a Carbon button, on Windows as a Windows button, on Linux as a GTK button, and so on. (No Cocoa buttons for Mac! Cocoa’s GUI architecture is too deviant from the norm for the wxCocoa project to have gotten very far.)
I mentioned this to my friend Eric, a Java dude, a year or so ago, and he said, “oh, just like the old awt!” I was a bit taken aback, because the Java awt (abstract windowing toolkit) was a notorious failure. Awt-based applications were ugly and tended not to work right on platforms other than the one they were mainly developed on without major bug-squashing effort.
Kind of like wxWidgets applications….
I put it out of my mind until, googling for information on making universal binaries for wxMac applications, I came across wxUniversal.
The wxUniversal port is a SciTech Software-sponsored project to create a set of widgets that are implemented in wxWidgets itself. In all previous ports, with some exceptions, each widget class is a wrapper around an existing implementation on that platform. A wxUniversal-based port therefore needs only need a relatively straightforward effort on each new platform, to provide basic classes such as wxWindow, wxFrame and wxDC.
Wow, that’s… that’s exactly what Java ended up doing with Swing. They implemented widgets themselves, so they only had to port some basic drawing and event primitives from platform to platform, and they weren’t burned by differences in architecture between various platform-specific widget sets. Then Swing implemented “pluggable look and feel” to allow it to adapt to the look and feel of the various target platforms, so it could blend in without actually using the native toolkits…
wxUniversal supports a theme system to change the look and feel, and there are currently two themes: WIN32 and GTK+.
DOH! History repeats itself again. And I’m a decade late.