views:

3177

answers:

22

Alright, this is a rather odd question that doesn't have one true answer:

What is the * Best || Easiest to Use || Most Powerful || Cleanest * GUI API or library (tk, SWING, Qt, etc.) you have had the privilege to use?

I've had conversations with friends about how annoying XYZ API was to deal with and how someone could build a better one, and I was curious what other's thoughts were on the subject. Is there a good and straightforward way to implement a GUI from the programmer's standpoint, and has someone done it yet?

+1  A: 

Tk was probably the best answer a couple of years ago, but it seems to have been surpassed by QT these days. PyQT (using Python) is quite nice. Both are quite reasonable in cross-platform environments.

I took a Cocoa class (Mac) and, as far as being polished and nicely finished, was quite nice. At the time you could only use Objective-C, but I think now there are some scripting interfaces for it.

Mark Harrison
+4  A: 

I don't think it meets all of your requirements, but I can't pass up the opportunity to promote Shoes (for Ruby) http://code.whytheluckystiff.net/shoes/. It's easy to use and very clean, and given it's simplicity it is pretty powerful.

Anyways, it's really fun. Check out the official manual for what can only be considered the most crazy programming manual ever!

Karl Seguin
What kind of keyboard is it on that page?
BubbaT
Is there another link. That one is not working, much...
Yar
+9  A: 

I can't say enough good things about Qt. I've been programming with it for about a year at work, and its put anything else I've messed with in the past to shame. There's almost nothing you can't do with it, it seems. Qt has a wysiwyg designer, but I do all my gui stuff in code. Its very clean and straightforward. Also, it has a free open-source version. Can't beat that.

JimDaniel
+8  A: 

Cocoa is fairly great. A big part of that is that the GUI layout is all done in Interface Builder, including "connections" between objects. And objects that you place are archived into the application, so you don't have to create them at runtime, all of the unarchiving is automatic.

Mark is right, there are now Python and (I think) Ruby interfaces for Cocoa. Meaning you can build a complete Cocoa application for Python. Including Core Data, and all of the other cool stuff, too.

Matthew Schinckel
+9  A: 

I think wxWidgets is great. Not only cross-platform, but also cross-language.

It supports Win32, Mac OS X, GTK+, X11, Motif, WinCE, and more. You can program in Python, C++, Perl, Java, Javascript, C#/.NET, and others and get a native UI on all platforms.

Compared to the earlier suggested Qt: Qt doesn't have true native ports like wxWidgets does. Even though Qt draws them quite realistically, Qt draws its own widgets on each platform (from the wiki). I didn't work with Qt, so I can't compare the developer-friendliness of the API's.

Cocoa, suggested above, is also very nice, especially with the added API's Apple gives on the Mac OS X platform. That is also it's drawback: Cocoa is single platform.

Daan
steffenj
+1  A: 

I've been enjoying Shoes in Ruby, but it has the downside that the code isn't stable yet.

But it takes an elegant approach to creating GUIs that's simpler than many other things I've played with.

engtech
A: 

I've only used wxWidgets myself but find it quite nice. As Daan said, it is supported across a lot of different platforms and languages making the code quite portable.

dagorym
+4  A: 

Best || Easiest to Use || Most Powerful || Cleanest

I honestly don't think it's possible to answer this question without prejudice. Over the last 10 years I've used GTK+, QT and WXwidgets for a couple of larger projects and other toolkits for smaller projects and I honestly couldn't say I thought any of them particularly clean for a start.

The best tool is the one that suits the purpose and all of the popular choices support that purpose with relative similarity so it's down to which ever is best suited to your way of working, tool chain and user base.

A total none answer I know but sometimes the only right answer is the one that proves the futility of the question.

sparkes
+1  A: 

Please don't forget Shoes! For writing quick little apps to help you be productive, nothing is more enjoyable.

Frank Krueger
It is the cleanest and easiest to use among all GUI toolkits I ever heard of. Ruby's DSL capabilities at its best.
J.F. Sebastian
+2  A: 

@Daan

Compared to the earlier suggested Qt: Qt doesn't have true native ports like wxWidgets does. Even though Qt draws them quite realistically, Qt draws its own widgets on each platform (from the wiki).

That's no longer the case. QT now uses native widget rendering whenever possible for a more consistent feel.

"Recent versions of Qt use the native APIs of the different platforms to draw the Qt controls, and so do not suffer from such issues." - Wikipedia

Derek Park
A: 

I like GTKmm, the C++ wrapper library for GTK+. It works on Unix and Windows recently. The documentation is good, is easy to learn, etc. I really recommend it.

lurks
+2  A: 

FLTK

Yeah, it's kinda ugly, but it's cross-platform and super clean.

Terry Lorber
+1  A: 

I used Qt at my last job, and really enjoyed it. We reskinned the whole app and were able to keep a very consistent interface and look across several platforms. The Qt documentation is nice to use, and rarely did I have to dig into the source of Qt to figure out how something should be used.

We were writing a commercial app, and so had Qt support, which was very responsive to questions, and would add in bug fixes to the next release when informed about them. As new versions were released I found the new features helpful, so they are making it better with every release.

I cannot recommend Qt enough.

+2  A: 

I like Cocoa.

Besides the obvious Objective-C Cocoa now has bindings for Python and Ruby (although that might only work on Mac OS X 10.5 I don't know) and Java (deprecated).

Cocoa can also be used from C#, but I wouldn't recommend it (yet):

http://www.netneurotic.net/DNET/StupidWordCounter/

I hope that Apple will look into C# bindings. Novell don't have the time to waste on non-Linux.

Andrew J. Brehm
Apparently there is now a new method to call Cocoa APIs from C#:http://code.google.com/p/mobjc/wiki/Usage
Andrew J. Brehm
Turns out Novell now have time to waste on non-Linux: http://tirania.org/blog/archive/2010/Apr-19.html
Andrew J. Brehm
A: 

IMO, VB6 even for the hack of a language, etc... It was hands down the quickest, easiest, etc...

kenny
+18  A: 

I've used a few GUI systems: MFC, Borland C++ Builder, .net Forms, wxPython, PyQt, Tk, GLUI, various custom rendered libraries.

What makes them easy to use is:

  • Stable, mature, well maintained code.
  • Good documentation.
  • Lots of sample code.
  • GUI designer tools.
  • Good platform support, i.e. can you compile it easily for your platform?!
  • If you need cross platform support, how mature is it?
  • Does the solution use a framework? How easy is it to use/extend/avoid?
  • License that matches your development needs. E.g. is it GPL?

Depending on what you need to do you go through the list and then make a decision. What you might have chosen last year you might not chose this year. Some solutions get better, some have fundemental flaws, but are usable, some are just bad.

Here is my experience, and opinions, with each, in case it's useful:

  • MFC - A fairly thin layer over the win32 windows API. Provides quite a good dialog designer, but no form designer. Well documented and stable. Complicated to customise the application form. Buggy with docking. Avoid in favour of .net Forms.

  • Borland C++ Builder - (Delphi but C++). Wasn't particularly useable until version 4 or 5. Version 3 IDE was buggy and crashed. Best Windows GUI designer around until MS poached Borlands lead architect (to design .net). Too many Windows IMHO, not an MDI UI. Also introduced interesting C++ language extensions like properties (like .net). Didn't try Delphi and Pascal although there are plenty of projects using this.

  • .net Forms - Great GUI designer. Choice of languages to use because of CLR. Well designed framework. Smallish apps tend to generate large applications in memory because of assembly dependencies. Good docs and support. Currently the best C++/C# solution for Windows.

  • Tk(inter) - Default GUI solution for Python. Usable but looks dated. Lacks widgets like treeview, which are pretty useful. Can be extended with libs to provide these. I think ActiveState distro has these. There are better solutions for Python these days, but a number of years ago this was the best supported, best cross platform solution.

  • wxWidgets/wxPython - Probably the most portable, comprehensive open source GUI library. Good docs and samples. I used wxPython extensively but then have stopped using because: ** Lack of decent GUI designer. Boa not compatible between wxPython versions (parses code). XRC editor too buggy and limited in functionality. ** Too many widgets being added when the existing ones need work. ** Generally too many bugs in distributions.

  • PyQt - IMHO this is the best Python GUI available at the moment. Excellent design and docs. Fast, simple flexible widget set. Why I think this is better than wxPython is that there are less widgets that do more. Also Qt Designer is easy to use and very powerful. Based on well maintained and very mature Qt API.

  • GLUI - Simple widget set written in OpenGL. Added this because not all GUIs are native. Not really an application framework.

So after using all these I'd say it's a toss up between .net and Qt. The others were either a lot of work to figure out how to do anything complicated, lacked important widgets, lacked documentation or were buggy/slow. It's not just the API that's important either, it's the support, i.e. tools and docs.

If you're using Python I'd say use PyQt, and if you want to avoid the GPL license without paying, go for wxPython. Haven't really tried PyGTK but it looks a lot more mature than when I looked at it a year or two ago.

If you're using C++ then both Qt and Forms are great. Qt you have to turn metadata into code, whereas Forms is immediate editing. Both a pretty well designed and great docs.

Nick
The GUI library of Embarcadero (was Borland/Inprise) C++Builder is known as **VCL** (Visual Component Library). See http://www.embarcadero.com/products/cbuilder
MaD70
+2  A: 

Tk (especially when combined with Tcl) is the easiest and most productive I've personally used, by far. My experience includes X11/Motif, Domain/Dialog (Apollo computer), OpenLook, Borland Builder on windows, VB, Java/Swing.

I've seen comments on stackoverflow that say Tk is outdated or ugly, but Tk 8.5 (out for a year or so now) uses themes which include native widgets when possible and looks quite good. Tk's widget set is a smidge on the lean side, but honestly, in the dozen or so years I've used it it's really not been an issue. 8.5 brought in some new core widgets -- most notably treeview, combobox, notebook and progress bar widgets -- which is all most apps need. It's quite possible to make clean, modern looking GUIs with Tk.

For the vast majority of day-to-day bread-and-butter GUI development, Tk is still a great choice.

Bryan Oakley
+1  A: 

I'm using Ultimate++ which is a

C++ cross-platform rapid application development suite focused on programmers productivity. It includes a set of libraries (GUI, SQL, etc..), and an integrated development environment.

It currently work on Windows, Linux, Solaris, *BSD, WinCE and a port to MacOS is planned(though it run on MacOS if X11 server is available). It is licensed under BSD license.

A: 

I used QT with C++ for one of my last assignements at University last semester. This semester, I had a glimpse of PyQT as my brother is using it. I agree with Nick when he says PyQT is the best for Python these days. It's stable, cross platform, customizable and the QT Designer is just great.

Rodrigo
+2  A: 

If you use wxWidgets and lack a good tool to build dialogs, make sure you try wxFormBuilder. It's a excellent GUI builder, but not many people know about it. Make sure you use at least version 3.x since many things have been improved.

When using wxFB, many people get confused with problem of manual changes to the generated code (If you used Delphi or Visual Studio, that can be a problem). The idea is to have a base class generated by wxFB and do all your work in the derived class where you can change everything, without fear that regenerating the source file from the designer would change anything. Unfortunately, there is no talk of this way of doing it, so many people miss how great tool wxFormBuilder is.

Milan Babuškov
+1  A: 

If your're not aiming for cross-platform, take a look at HTMLayout (latest editions of Symantec products use it as well )

Mamut
A: 

WPF.

When done correctly you get things, no other GUI framework can do. However, it is necessary to use MVVM strictly.

Turing Complete