views:

961

answers:

14

Greetings,

I want to write a small cross-platform utility program with GUI in it. What language/GUI-library should I stick to? Is it possible whatsoever?

This is gonna be a small program, so I don't want to make people download JVM or .NET Framework. Is it possible to develop it natively?

Update 1.

By "natively" I mean that the end result will be native code without intermediate layers like Java Virtual Machine or .NET Common Language Runtime

Update 2.

A FREE solution is preferable ;)

+4  A: 

You want to develop a cross-platform program natively? Uh...I don't think that'll work, mainly because that phrase is a paradox. If you write native code, it by its very nature will only run on the platform you programmed it for. ;-) That's what the Frameworks are all about.

So what you should do instead is use a very slim framework if your program is going to be so small. itsmatt's idea of Qt is a possibility.

Epaga
+1  A: 

Have you looked at Qt?

itsmatt
+1  A: 

How about Python using Qt or Wx and then using PythonToExe to make a 'distributable'

Thought will have to giving to the development to ensure that no native functionality is used (i.e. registry etc.) Also things like line breaks in text files will have different escape characters so will need to be handled

Dean
+14  A: 

If you know C or C++ the first cross platform GUI framework I can think of are:

  • QT (C++, proprietary but free for non commercial project)
  • wxWidgets (C++, the most complete and stable but also huge)
  • FLTK (C++)
  • FOX (C++)
  • IUP (C, simpler and cleaner than the ones above)

If you know Pascal, you can try freepascal+Lazarus. I've never used it, though.

Remo.D
Excellent answer Remo.D
Onorio Catenacci
Qt is only free for GPL projects. Projects with other non-commercial licenses - including popular open-source ones like BSD or MIT/X11 - need to pay. FWIW, Qt is my pick thanks to its completeness and well-designed API.
skymt
Qt now has (free) LGPL licensing, so the above comment by skymt is no longer correct.
KeyserSoze
+1  A: 

WxWindows? Oh, it's called WxWidgets now: http://www.wxwidgets.org/

JeeBee
No problem. Actually it looks really polished now, might have to have a play sometime :)
JeeBee
+1  A: 

wxWidgets has bindings to all sorts of languages - python for instance, if your app is small enough.

Carl Seleborg
+3  A: 

The problem is: If you do not want to have a GUI but you do not want to ask the user to download an eternal API, Framework or virtual machine to run it in, be it TCL/TK, Java or QT etc. then you get lost pretty fast.

The reason is: You would have to rebuild all the (GUI) functionality those APIs, frameworks and virtual machines provide you with to be platform independent. And that's a whole lot of work to do... .

On the other side: The Java virtual machine is installed on nearly any operating system from scratch, why not give this one a shot?

Georgi
A: 

If it "HAS" to be Desktop use Qt. Nothing beats it right now.

However personally I gave up on desktop and any UI based project I do is normally Browser/Server based. You can easily write a little custom server that listens to some port so the program can run locally with no need for your users to install Apache or have access to the net. I have a small Lua, Python and C++ framework I made for that purpose (Want to add Javascript for the backend with V8 :)

Robert Gould
+2  A: 

Which OS's do you have in mind when you say cross-platform?

As Epaga correctly points out, native and cross-platform are mutually exclusive. You can either write multiple versions that run natively on multiple platforms, or you need to use some cross-platform framework.

In the case of the cross-platform framework approach, there will always be extra installs required. For example, many here suggest using Python and one of its frameworks. This would necessitate instructing people to install python - and potentially the framework - first.

If you are aiming at Windows and OS X (and are prepared to experiment with alpha-release code for Linux if support for that OS is required), I'd highly recommend you take a look at using Adobe AIR for cross-platform GUI applications.

David Arno
A: 

If you're going to look at Qt and WxWidgets, don't forget to also check out GTK+ !

Adam Pierce
A: 

Flash? It's installed pretty much everywhere.

Rory
A: 

I agree with Georgi, Java is the way to go. With a bit of work, you can make your desktop application work as a Java applet too (so that users do not need to actively download anything at all). See http://www.geogebra.org as an example of an application with runs smoothly as a cross-platform Java application AND has a simple port to a web applet.

Two other advantages to using Java are:

  1. They have extensive libraries for building the UI, including UI component builders.
  2. The Java runtime framework is generally updated automatically for the user.

One disadvantage:

  1. The version of Java installed on your end users computer may not be totally compatible with your application, requiring you to code to the lowest likely denominator.
David Wees
+2  A: 

Try RealBasic. Visual Basic-like syntax, targets Win32, OS X and Linux. I don't know any details about targetting Linux, but for any cross-platform development I've done between Win32 and OS X its been a dream.

http://www.realbasic.com

Edit: Generates native executables. There is a small cost - $100.

hunterjrj
+1  A: 

Lazarus is great. GTK2 on Linux, win32/64 on Windows, WINCE on euh, Wince. It even uses Carbon on Mac (working on COCOA). Also easy to sell to your boss (the code is Delphi compatible)

Marco van de Voort