History Repeating Itself: wxUniversal

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.

5 thoughts on “History Repeating Itself: wxUniversal”

  1. Huh, was that me? I think I would have said that, but I don’t think I remember the conversation if it was I.

    Time to go look at my code to find all of my ‘parallel but late’ portions.

  2. That would be you, ee. :)

    I don’t remember exactly when or in what context though.

  3. I seem to remember Ed describing wxWidgets to me at one point and thinking that it sounded like the AWT. I didn’t know that you were having pretty much exactly the same problems though.

    Are you guys planning to switch to wxUniversal at some point? It sounds like it would be less hassle–provided of course that switching wouldn’t be an unbearable pain.

  4. Neh. wxUniversal’s embryoic.

    I don’t know what the future is, and I try not to think about it too hard because if I do the twitching begins.

Comments are closed.