views:

243

answers:

6

I am attempting to write a cross-platform GUI application that would be deployed to Windows, Mac OS X, and Linux. My requirements are:

  1. Single code base for all three deployment platforms, without a large amount of conditional logic for handling differences between platforms.
  2. Looks as close to "native" as possible on all three platforms.
  3. Easily distributable to all three platforms, in the sense that it could be easily installed by end users and does not suffer from extreme bloat (as discussed in this ArsTechnica article.)

Based on these requirements, I've narrowed down the selection of toolkits to Qt and wxWidgets, since none of the other toolkits that I know about (including Java's Swing and SWT, Flex, AIR, etc.) satisfy the "native-looking" requirement. Among these two final contenders, Qt appears to offer better support for applications that look and feel native on all three of my deployment platforms, but I'm willing to consider opinions to the contrary.

I would prefer not to use C++ as the implementation language, but I'm not sure if there are any practical alternatives. My biggest concern about using an implementation language other than C++ is the deployment problem. As discussed in the Ars Technica article, PyQt does not meet the "easy deployment' requirement in any practical sense, and I suspect that most other language bindings for Qt would suffer from the same deployment problems (at least on Mac OS X). Java (or Scala) with QtJambi? QtRuby? wxPython?

Does anyone know of any combination of language and toolkit that satisfies all three of the above requirements?

A: 

.Net (C# or VB.Net) is what I would use for this (in fact, it is what I use for my own application). Thanks to the Mono project, .Net applications can run on Mac and Linux as well as Windows without any modifications to the code (unless you're calling Windows API functions). You don't even have to compile different versions of your program: the same EXE will run on all platforms.

MusiGenesis
How does deployment/installation work for Mono applications? Is it an onerous process for the end user on Mac OS X (meaning do they need to install Mono separately, and then install my application), or can I create a simple .app file and distribute that? Do Mono applications look native on Mac OS X?
Jason Voegele
kemiisto
MusiGenesis
@MusiGenesis: I'm not surprised to hear Mac OS X look -) But believe me most of Mac users really like it and feel quite uncomfortable with any other alternative. May be 100% owner-drawn is another option...
kemiisto
@kemiisto: I don't really think the Mac OS is terrible - just overrated. And I fully understand the desire to have applications act like they actually belong in your OS - I use iTunes in Windows. :) That's why I go with an interface that doesn't seem to belong to *any* OS.
MusiGenesis
+4  A: 
  1. It depends on your needs. But in general Qt Framework (with any language) and Java SE (with any language) is much more better because it has not only cross-OS GUI libraries but also cross-OS networking, threads, ... wxWidgets is GUI only.
  2. Both Qt and wxWidgets are nice. In my experience Qt is better. Swing is... Well, not so nice.
  3. Both Qt and wxWidgets applications written in C++ and Java Swing applications are not so hard to deploy on Windows, Mac and Linux. The rule is that the deployment is simple when you are programming in "native" language. By "native" language I mean the language a framework itself is written in.

PyQt does not meet the "easy deployment' requirement in any practical sense...

Python (and any other language with the default implementation as interpreter) apps is hard to deploy in the usual sense (I mean in form of standalone executables).

So probably you have 2 choices:

  1. C++/Qt or C++/wxWidgets.
  2. Java/Swing if native look & feel is not very strict requirement.
kemiisto
Thanks for the answer. I'm afraid that this is what I suspected the answer would be. "Afraid" because I really would rather not use C++. Oh well, at least C++ with Qt is not as bad as C++ with, say, MFC. :)
Jason Voegele
A: 

Java/SWT is one of the good choices. You can find a lot of information about it here.

Ha
Having used Eclipse for many years, I do not feel that SVT produces applications that look and feel truly native.
Jason Voegele
Eclipse doesn't look native because of its library containing cool-looking custom components.
Ha
+2  A: 

wxWidgets is quite good, and does contain some non-GUI code (contrary to what kemiisto said): threads, sockets etc.

The nice thing about wxWidgets is that wxPython actually should be pretty easy to deploy on OS X. There are some other language bindings for wx, but wxPython is probably one of the oldest ones.

RyanWilcox
It's all relative! Comparing to Qt Framework or (especially) Java SE wxWidgets is GUI-only library.
kemiisto
If it is truly easy to deploy a distributable wxPython app to all three of my target platforms, then that would be a winner for me. Is it possible to create a standard ".app" file for Mac OS X that users could "install" by the usual mechanism? Or would they need to install support libraries first? If it is possible to create a single .app bundle, would it be bloated in the same way that PyQt applications apparently are?
Jason Voegele
You should be able to package the wxPython framework inside the .app for OS X (translation: package it up so the user doesn't have to install the support libraries first). Failing that you might have to create an Installer using Apple's PackageMaker which installs both wxPython and your app.wxPython is also preinstalled on OS X (BUT on my 64bit machine only the 32bit version is installed, so it gives me an error)... and I'm sure it's an older version of wxPython so you might not want to use that.
RyanWilcox
A: 

Java does support "native-looking" applications by using the SystemLookAndFeel. The quickest way to try is to invoke the following at application start up.

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Take a look at this for more information on the available Look and Feels in Java.

http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html

Tansir1
Try it on KDE! ;-)
kemiisto
kemisto, as a KDE user, I know exactly what you mean. Swing applications look horrendously out of place on KDE, and even under Gnome the native look and feel is only skin deep.
Jason Voegele
+1  A: 

Have you looked at REAL Studio (formally REALbasic)? It definitely meets all three of your requirements and it is much simpler to learn and use than C++.

Paul Lefebvre