Cross Platform GUI Programming

Ranked #1,756 in Computers & Electronics, #29,249 overall

I've been programming for the desktop since 1992 and have used many cross platform toolkits and languagues. This is my advice for creating cross platform GUI software.

Things to consider

Some of the things you need to think about before choosing a cross-platform toolkit.
  1. Proprietary vs. Open source. Not just paid vs. free, open source means that you have access to the source for debugging and also to change. Some toolkits straddle the boundary. Java is free but not open source, Qt is not free, but is open source.

  2. Ease of deployment. If you depend on a language with a runtime, it will have to be installed. Java is one of the biggest and most difficult to deploy. C++ applications have no runtime requirement and RealBasic also compiles to native code with no runtime requirement.

  3. Native controls vs. emulated. Some toolkits use native controls and provide a cross-platform layer on top of them (SWT, RealBasic) and some emulate controls using lowerlevel graphics commands (Swing). Some use native where available and then emulate the rest (WxWidgets). Native controls will act the most like what the user expects, but emulated controls will be the most portable (will work the same way on all platforms). You might also find that emulated controls are easier to extend since more of the code that implements them is cross-platform, which extending native controls must be done for each platform.

  4. Programming Language. Most toolkits are locked into a specific language. Some provide language mappings to make them more cross-language. The language you use also limits what other toolkits you can use in your application.

  5. Third-party support/user-community. Is there support from other vendors and groups? What about the user-community -- is it active, do questions about the technology get answered in forums? Is there a lot of information available on the web in general about the toolkit.

Capabilities to test

When you are evaluating your choice, consider testing to make sure the following capabilities are supported by your GUI framework.
  1. Ability to create and remove components dynamically (and add and remove events on those components as well)

  2. Support for custom components

  3. Ability to support standards of each platform (Dialog button order on Mac is different from Windows, Mac has one menu per app -- Windows has a menu per window, standard file locations, etc)

  4. If the framework requires a specific language, is there interoperability with languages that you might want to use for non-GUI portions?

  5. How good is image support -- check image resizing. If it's not good enough, can it support adding in ImageMagick?

  6. Cross platform support for background processes (with a presence in the task bar)

Articles on Cross-Platform Design

SWT Implementation Strategy
This article about SWT gives a great overview of what it's like to create a cross-platform toolkit.

Cross Platform Toolkits

WxWidgets
Open source C++ GUI Framework.
Qt from TrollTech
C++ GUI Framework. Free for non-commercial use.
Java
Java has Swing and AWT for cross-platform GUI programming.
SWT
SWT from the Eclipse foundation uses native controls in Java. The result is that applications feel more native than Swing.
JavaFX
Infoworld article about JavaFX. Uses the Java stack for implementation, but the development is done in a declarative way.
RealBasic
Proprietary language and toolkit that is based on Basic. Tools for converting your Visual Basic projects.
AJAX
AJAX techniques make web based applications more rich. If it's good enough for your application, you'll have the added benefit of being able to host it on the web.
Flash
Flash applications run inside and outside of the browser. No native components, so not good if you want native look-and-feel, but good for non-standard GUIs.
List of GUI toolkits
This list has a comparison chart. Very comprehensive.
ImageMagick: Convert, Edit, and Compose Images
Open source image manipulation library to use in conjunction with your GUI toolkit. Goes far beyond what they usually offer.

Developer Discussions

Discussions between developers on the various toolkits and tradeoffs
Cross-platform GUI dilemma
Discussion on JoelOnSoftware boards
REALBasic Vs. wxWidget Vs. Net
Discussion on JoelOnSoftware boards
Anyone here use QT?
Discussion on JoelOnSoftware boards
RealBasic for non-trivial desktop apps?
Discussion on JoelOnSoftware boards
Feedback on cross-platform toolkits?
Discussion on JoelOnSoftware boards
The Business of Software - porting Windows to Mac
Discussion about the use of QT for a specific application.

Books about cross platform GUI Development

Loading

by

loumf

Lou is a software developer from Northampton, MA. He is interested in
local grassroots politics, programming, and fitness (weight training,
running,...
more »

Feeling creative? Create a Lens!