18 Oct 2004 elanthis   » (Journeyer)

Cross Platform UIs

Raph: please do duplicate the UI for each platform. That is 100% the correct thing to do. Even when you have a cross platform library (and BTW, GTK+ runs natively on Windows and runs in X11 on OS X, and it's possible to port GTK+ to Aqua if you really wanted it), you have to understand that that doesn't mean that the app actually behaves properly on each platform.

Take something like OpenOffice.org. It works, looks, and acts great on Windows. Bring it to Linux and it still works, looks, and acts great - as a Windows-based UI. Same on OS X. The app feels completely alien and out-of-place anywhere but Windows.

Cross platform UI libraries can't fix this fact. They can let you write code that works on multiple platforms, but they can't let you design user interfaces that work on multiple platforms. At least none of the currently popular cross platform toolkits.

Your absolute best bet is to do what the Abiword developers did - split the UI code from the main app, and write UI code for each target platform. That way, not only does it run on OS X, it follows the Aqua HIG and generally looks, acts, feels, and behaves like any other well-designed Aqua-native app. On GNOME, it looks and acts mostly right. On Windows, you can't tell it apart from any other (properly) Designed for Windows app. Same for the other platforms it supports.

There is just so much more to developing a GUI than just how to draw buttons. That's all a technical solution (i.e. a toolkit library) can solve for you - the low-level details of getting widgets on screen and responding to events. When it comes to layout, widget choice, behaviour of widgets, interface integration, and so on, you really do need to redesign the UI for each target platform. Otherwise you end up with a monstrosity that feels alien and uncomfortable for users of all platforms other than your main target.

If you do want a technical solution due to development time, stick with GTK+. Just make sure you use libglade. That way you can ship a different .glade file for each platform. Plus, since it's rendering engine is replaceable (themeable), it can look native on all major platforms. (It's feel might be a little alien, but it should be Close Enough(tm) in most cases.)

[#] Comments

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!