Live data from Hacker News

Ask HN: An acceptable cross-platform GUI toolkit?

news.ycombinator.com

1–10 of 57 posts

Ask HN: An acceptable cross-platform GUI toolkit?

#1
It's interesting but disappointing that there's no standout "winner" among desktop GUI toolkits. Among other things, devs want to write software that runs on their favorite GNU/Linux distribution, but that also runs nicely and is easily installed on MS Windows and Mac OS X. Here are the arguments I hear against some current popular toolkits:

* GTK+ -- Has lots of moving parts. Difficult to build/install on MS Windows. Some say it's too closely tied to X11. Doesn't look enough like MS Windows on MS Windows. The LGPL licensing is very successful though, as demonstrated by the fairly large developer community and by its use in Gnome.

* Qt -- Either GPL your software or pay the licensing fees. Also some don't like having to deal with C++ if you're required to ever look under the hood. Nice that it comes in one big piece though.

* Tk -- Some have referred to Tk as a vistigial GUI appendage from a bygone era. Also it depends upon Tk. This one would be a hard sell to get everyone to agree on.

* wxWidgets -- Complaints are that it looks too much like the MS Windows API, and also that it's too big (being a wrapper around lower-level GUI toolkits).

It would seem that we (the free software community) should just bite the bullet, list out the basic requirements for a successful GUI toolkit, and go ahead and create it. I'd dare say that the requirements might look like this:

* Written in C. C is fast, portable, and everyone knows it. Corollary: keep it simple (like Tk) and packaged in one piece (like Qt). Having a half dozen different pieces all bolted together (like GTK+) in the name of modularity only makes it harder to create easily-distributable cross-platform apps. 2nd corollary: be careful not to tie it too closely to X11.

* Keep it simple so it's easy to port to Windows and Mac OS X (Cocoa). Corollary: simple and easy to build too.

* LGPL licensed. Most camps can probably (at least grudgingly) come to agreement on this, and it's worked pretty well for GTK+. Works for free software and for commercial apps, and tends to build nice communities.

* Can easily be made to look like MS Windows on MS Windows, and Aqua on Mac OS X. I really don't care if it's themable or not, but for wide adoption, it had at least better be able to easily make itself look like MS Windows and Aqua.

* Easy to make bindings for Python, Ruby, Perl, etc. I really do not want to write GUI apps in C, but I don't want it so fancy that you have to do acrobatics to mate, say, Python, to it.

* Simple and easy to use (like Tk).

Anyone working on or know of that cross-platform GUI toolkit? Because that's the one I want to use, and I bet it's the one a lot of devs would also want to use.

Re: Ask HN: An acceptable cross-platform GUI toolkit?

#4
I am most curious about GNUstep (gnustep.org). GNUstep is similar to the Window Maker window manager on Linux, like Cocoa uses Aqua on Mac OS X. From what I've seen, GNUstep and Cocoa are very similar (both Objective-C, both using the original NS* classes, etc.) and the project aims to remain compatible with Cocoa where possible. I've used both Window Maker and Aqua, and I like both GUI styles.

Apparently GNUstep is usable on Windows, but I've never tried it.

At least in theory, the same Cocoa-like source could be used for a GUI app on all 3 major platforms.

Objective-C isn't as simple as C, but it's pretty simple, and fully compatible with C. It's also been bound to every major scripting language I can think of.

Re: Ask HN: An acceptable cross-platform GUI toolkit?

#5
'GTK...Doesn't look enough like MS Windows on MS Windows.'

GTK apps for the most part look exactly like other Windows apps [1], and have for the last threeish years. Some, however, still use GTK style File dialog boxes, rather than native Windows ones.

Alas I haven't written any GTK for Windows, so I'm not sure what determines the File dialogs.

[1] Per poster below, I mean Microsoft apps included with Windows XP or Vista

Re: Ask HN: An acceptable cross-platform GUI toolkit?

#6
post #5

'GTK...Doesn't look enough like MS Windows on MS Windows.' GTK apps for the most part look exactly like other Windows apps [1], and have for the last threeish years. Some, however, still use GTK style File dialog boxes, rather than native Windows ones. Alas I haven't written any GTK for Windows, so I'm not sure what determines the File dialogs. [1] Per poster below, I mean Microsoft apps included with Windows XP or V…

"Other Windows apps" is itself vague.

There is an alternative style for Qt which can be configured for ".NET application" or "Microsoft Office" looks, which are not the same as the default "Windows" look which call into the Windows theming engine.

http://doc.trolltech.com/solutions/4/qtdotnetstyle/qtdotnets...

Re: Ask HN: An acceptable cross-platform GUI toolkit?

#7
wxWidgets is "big" because it has features. Considering it meets all your other criteria (aka features), in addition to ones you'll only find out you need halfway through a project, I would look closer at it. Use wxGlade and wxPython if you want easy, C++ if you demand compiled. Use dabo (http://www.dabodev.com) if you are interfacing with databases.

Re: Ask HN: An acceptable cross-platform GUI toolkit?

#8
the thing is, GUI is often connected with some messaging system like D-bus or WM_XXX, and that's platform-dependent. And also API for C/C++ is so different. Some may relate to performance demanding 2D even 3D features. The expansion list goes on and on.

The true thing we need is a minimal & native implementation of cross-platform GUI kits.

Re: Ask HN: An acceptable cross-platform GUI toolkit?

#9
post #2

Shoes has been more and more impressive lately. I'm not sure about ports or equivalents in Python and Perl, but people are doing great things with it in Ruby. http://github.com/why/shoes

I give two thumbs up for Shoes - I'm learning Ruby just so I can use it. However, running through the list of GUI kits the poster has assessed, Shoes differs significantly in that it incorporates web-style widgets on the desktop. It is much more suited to graphical applications and games than native desktop software.

Two thumbs down for wxWidgets. I used the wxPython port to prototype a not-too-complex desktop application, and found it tediously cumbersome (not to mention ugly). I would've been better off coding it natively in Obj-C and then porting it down the track.

Post reply on HN