views:

1147

answers:

10

I am thinking about cross-platform with nice programming language bindings (Java, Ruby and Python). What would be the "flattest" learning curve but yet enough powers to perform most of the standard GUI features? What would you guys/gals recommend; FOX, wx, Tk or Qt?

+16  A: 

I would go with Qt. It works on all the major platforms, and it's being continually improved. You can also get started really fast. There are bindings for Java, Ruby and Python.
Plus it's free if you're writing open source programs.

PiedPiper
Plus, it's free if you're writing open source (released as GPL) apps.
Matt
its LGPL, so its free regardless of what licence you use for your app.
gbjbaanb
Qt4 has the best BiDI support if you do need to support RTL scripts. The most flexible, and IMHO the richer.
elcuco
@gbjbaanb: Qt itself is LGPL, but the Python bindings are GPL, see http://article.gmane.org/gmane.comp.python.pyqt-pykde/15551
dF
Is there a special badge for getting 12x the accepted answer? ;-)
Charlie Martin
Maybe there should be: try suggesting it. This kind of question is very subjective anyway, so there's not *right* answer.
PiedPiper
@PiedPiper I agree on that one. I will try to make simple app in Python or Ruby and try to ship a binary executable version for Mac OS X, Ubuntu and Win XP using those toolkits. Thats basicly my goal.
davidhalldor
+4  A: 

Honestly, I've built things with Tk, wx, and Qt, and I hate them all equally. Qt's visual editor is the least obnoxious of the three I think.

Charlie Martin
Most professional Tk programmers I know agree that Tk is so easy to use that a visual editor just gets in the way. Whether that says anything about the relative ease of use of Qt or wx compared to Tk, I don't know.
Bryan Oakley
Well, I still like curses anyway.
Charlie Martin
@Charlie Martin Given your history I know why :-)
lothar
Now, be nice, son. you'll be old too someday. Maybe.
Charlie Martin
+1 for curses :) Can even add MS-DOS into the list for cross-platform!
Van Gale
+1  A: 

I've not worked with Qt, so I can't judge it, but I have worked with wx and it's quite easy to work with and still quite lean. Also, wxWidgets gives you native widgets on every platform, which is a huge advantage (especially for Macs). While the others emulate the look-and-feel of the native platform, wxWidgets directly uses the native widgets which is faster for many situations.

arke
Not entirely true -- Tk uses native widgets on platforms that have native widgets (read: Windows and the Mac). There's no emulation, you get the real deal.
Bryan Oakley
+2  A: 

If you're considering Java, SWT is an excellent cross-platform GUI toolkit.

Kekoa
+3  A: 

WX all the way! I am not a GUI expert, designer or a even a "GUI guy", but recently I needed to write a front end for a product config tool (actually it's a collection of tools, but we wanted a single interface to access and run them all).
The tools are all written in Python so naturally I turned to Python for the UI.
I settled on wxPython... one "import wx" and a few tutorials later, I was banging out frames, notebooks and button panels like I knew what I was doing.
I found plenty of examples to help me when I got stuck and the wxPython docs were very useful - although they are just C++ docs, they were still pretty intuitive.
A quick web search will turn up tons of wxPython tutorials to get you started.

I've written and refactored the UI couple times, but I had a clean, working prototype in < 1 day. The tool was cross platform and all the windows and frames matched the native window system (WinXP, Win2K3, Gnome, etc.) - I was definitely impressed. If I ever have to write UIs in any other language I will certainly be looking for a wx implementation.

joel
I haven't tried the others but I am going to agree strongly with Joel. Further the documentation with wx is really good. Look at my handle-I started working with Python seriously in October, had limited programming experience outside of SAS and by December I had an application with a well functioning and so far stable GUI.
PyNEwbie
+2  A: 

Tk is still a very viable solution. The learning curve depends a lot on you. Many folks, like myself, can or have learned all the fundamentals of Tcl and Tk in about a day. There are those that still fight the syntax after years of use. It all depends on how good you are at "unlearning" things you've learned with traditional languages like C and Java. If you have any lisp in your background you can probably learn Tcl in a morning.

Another benefit to Tk is the fact it works with Tcl, Perl, Python and Ruby (and others) so you aren't stuck with a particular language. Though, there's no direct port of Tk to Java. Learn it in one language and your knowledge will transfer over pretty easily to other languages. Tk comes out of the box with Tcl and Python so for those languages there is nothing else to install.

I will say, though, after writing several hundred lines of Python/Tkinter code the past few weeks I much, much prefer coding in Tcl when it comes to GUIs, but that's more of a personal thing than anything else.

For more on Tk with Tcl, Ruby and Perl see http://www.tkdocs.com

Bryan Oakley
wx looks better than Tk for my opinion in for example Mac OS X, since Tk runs on X11. For Ruby it was installed via rubygems and easy to use but it was even easier to start with Tk since it was build into the Mac OS X. I will probably go for wx for either Python or Ruby projects.
davidhalldor
Tk has a carbon port and cocoa is in the works, meaning you you aren't stuck using X11 on the mac unless you want to. Visit the tkdocs.com website to see examples of native widgets on the mac and windows. And Tcl/Tk comes with OSX so you don't need to install anything.
Bryan Oakley
There ought to be some sort of special badge for getting an accepted answer with no net upvotes, as this one shows right now.
Charlie Martin
yeah, it surprised me too. I don't think it's the definitive answer, just one opinion among many.
Bryan Oakley
There is no correct answer to my question but I found this answer closest to what I was asking for.
davidhalldor
@Bryan, what's worse is I then upvoted you.
Charlie Martin
+1  A: 

If Java is your preferred language, consider Groovy. It is a really nice dynamic language that sits on top of Java, and has some really nice features (SwingBuilder) with respect to writing GUIs. If it wasn't for the fact I'm highly productive in Tcl/tk, I think Groovy would be my personal second choice even though I'm not a big fan of Java or Swing per se. Groovy looks to take a lot of the tedium out of both of those.

For more information see GUI Programming with Groovy.

Bryan Oakley
I find Groovy really interesting and I will definitely check on making Swing GUI's. Many great IDE's got nice Swing tools/addons such as IntelliJ and Eclipse.
davidhalldor
+1  A: 

I recommend Gtk. It is a nice, cross-platform, good-looking toolkit. It is designed with language bindings in mind and allows create nice language bindings (pygtk, ruby/gtk2, java-gnome, gtk# and more). Gtk+ is quite easy to learn.

dmitry_vk
+2  A: 

I strongly recommend the Rapid GUI Programming python development book. Author's Page.

I recall that Elsevier has released a Python-GUI book book but the link and the name escape me now.

dassouki
A: 

I just want to mention that Qt is much much more than just a GUI toolkit. You get so much more with it, all nicely integrated into the framework, that it would be well worth using it if you are considering crossplatform development. The only issue is that if you want to use it via its Python binding PyQt, you'll either have to pay for a PyQt commercial license (expensive) or GPL your code.

Emrah
@Emrah: can you define "more". What "more" do you get besides the GUI toolkit?
Bryan Oakley