views:

696

answers:

8

I want to produce a desktop application with a very simple GUI (a background graphic, a cancel button and a progress bar).

My main targets are Mac and Windows.

Is this possible using Visual C++ 2008?

Can anyone point to any examples using Visual C++?

Or is there a better way to create the GUI separately?

+9  A: 

I would recommend wxWidgets. It's crossplatform and works with Visual C++.

There's also Qt (see Colins post) which is what KDE (Linux desktop manager) uses. It has a more restrictive license though.

Skurmedel
Qt-4.5 is LGPL, how is that restrictive?
@ilproxyil: I didn't say it was restrictive. However it's slighlty more restrictive than (see wxWidgets http://www.wxwidgets.org/about/newlicen.htm). For most people I guess this difference is negligible.
Skurmedel
+3  A: 

I'd suggest you look at the Qt toolkit. It contains cross-platform UI elements. It is possible to use this with VS2008.

Colin Desmond
+19  A: 

Use Qt4. http://www.qtsoftware.com/products/

This is a self containing framework which contains developers tools, GUI builders, String/IO/XML/Thread classes, Audio/Video controls, HTML widgets and many, many more features. It's built to be completely multiplatform, one code for all systems.

In contrary to wxWidgets, it feels mode OO, and has by far better documentation. See it online: http://doc.qtsoftware.com/

elcuco
Additionally, it's been open sourced by Nokia a few months ago, if that sort of thing is important to you
Andy
I'm trying to figure out exactly what the Qt licensing means.If I am not selling my application but do not want it to be open source, do I need a commercial license? They are expensive!
joshcomley
Andy, it's been Free Sorced by Trollteck back in 2001 (GPL) and it was open sourced by Trolltech back in 1999 (QPL). Nokia also licensed under the LGPL license, but Qt was "always" free for non commercial work. LGPL makes it free for commercial usage as well.
elcuco
Qt is awesome for simple UIs like you are asking about. This is the correct way. However, If your UI gets more complex, more interactive, then QT may not hold all the answers....
Alex
Qt is fine for complex GUIs...what makes you think it isn't?
20th Century Boy
+8  A: 

You can also have a look at FLTK

FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and MacOS® X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL® and its built-in GLUT emulation.

FLTK is designed to be small and modular enough to be statically linked, but works fine as a shared library. FLTK also includes an excellent UI builder called FLUID that can be used to create applications in minutes.

Here are some quickstart screencasts

epatel
+1 for FLTK (you'll never stop me from saying EFF-ELL-TEE-KAY)! Although to be fair there are fewer widgets than Qt and some are uglier (which is subjective I know).
20th Century Boy
About fewer widgets; Sure it is. But I think it might be more in line what he's asking for - "a very simple GUI". Qt is great for sure, but not that much light-weight anymore.
epatel
+2  A: 
  1. GTK+
  2. QT
  3. wxWidgets

If you're asking about .NET then (assuming that's what Visual C++ 2008 is) then both Linux and Mac OS X users can run .NET applications with Mono.

Leo Jweda
+1  A: 

Gtkmm is C++ and is proved to work in linux and windows with Visual Studio.

piotr
+3  A: 

Since the user interface is so simple, I would advise you to start in Windows with Visual Studio, and keep all the user interface stuff in separate files, decoupling it completely from the rest of your application.

Then, on OS X, you'll get the best visual results by creating a Cocoa application and writing the user interface in Objective C in combination with Interface Builder. You can then easily hook up the interface with your internal C++ code. (The Objective C compiler understands C++ code in the same file as the Objective C code.)

This will let you produce a cross-platform application that looks just right on both Windows and OS X, something that QT or other cross-platform kits will likely never completely achieve.

Frederik Slijkerman
I like this because it is a free solution! It looks like other options like Qt will be expensive and/or difficult to work with to get things just right.
joshcomley
Qt is completely free and is a snap to work with. They have VS integration as well even with the open source version. The above answer recommends creating 2 separate apps in 2 different languages. Hard to justify for a simple GUI like you describe.
20th Century Boy
In contrast, for a simple GUI this is not much work, because most of the code will be shared. And it gives you the excuse to learn Cocoa. :-)
Frederik Slijkerman
A: 

Check out Fox Toolkit. It's lightweight, modern and looks quite good.

demonkoryu