Fog Creek Software
Discussion Board




Cross Platform UI toolkit, take two...

In my search for cross platform UI toolkits that have the following properties:

1) good C++ bindings (I don't mind using a language like python as long as it has good C++ bindings, although I currently don't know python, but the idea of a scriptable OO language sounds neat).

2) OpenSource, but not GPL.  I has to be open source, but use a more BSD style license.  GPL is too Stallman communist idealistic, as I have no interest in open sourcing my application. 

3) decent support (meaning many developers with an active community).

4) good looking controls and solid performance.

As a user of Mozilla the first place I turned was XUL as the new Firebird is the most stable and fastest browser I've seen in the market.  It looks like the XRE is heading the direction I want to go, but I'm not convinced it is there.  The support and stability don't meet my requirements.

The second place I am looking is wxWindows.  Has anyone used this package?  If so do you feel it meets my requirements.

Are there any other suggestions?

christopher baus
Thursday, September 18, 2003

Not to derail conversation, but what does using a GPL toolkit have to do with open sourcing your application?  There are clearly defined terms in the license for GPL toolkits which define how they may be used without requiring the app using them to be opened up as well.  The meat of it is that if you don't use that code directly, but rather make calls to it, you're okay.

Tool
Thursday, September 18, 2003

You said cross-platforms. What does that mean, linux and FreeBSD or BeOS and Amiga?

m
Thursday, September 18, 2003

Have you looked into Tilcon? Not sure about number 2) though.

UI Designer
Thursday, September 18, 2003

wxWindows works, is mature,  is built around C++, and is very much like MFC.  Everything you are used to with MFC is the same in wxWindows, with some adjustments in cases where the wxWindows decided to make things suck less.

The license is quite compatable with closed-source development.  LGPL with some added exceptions to section six of the LGPL.

Controls aren't the best looking, but wx strives for a "native" look.

I'd classify it as my preference as cross-platform UI toolkits go.

Flamebait Sr.
Thursday, September 18, 2003

It is not clear that GPL doesn't require you to release source to derived works (in fact the opposite seems to be true).  Hence the LGPL license.

That is what is meant when licence is said to be viral.  I don't want to start a big religious discussion, but GPL just doesn't meet my needs.

I prefer BSD/Apache style licenses for my use, but LGPL is Ok I guess.

christopher baus
Thursday, September 18, 2003

By cross platfrom I mean X, Windows, and OS X would be nice as well.

christopher baus
Thursday, September 18, 2003

I'd go with wxWindows. It's written in C++ but has a good, stable Python binding (wxPython), which is all I've ever used. I understand that it is available on windows, *nix and MacOS X with a variety of look and feels. On my relatively slow machine (3 year only 800Mhz P3) it feels quite fast under both windows and linux (KDE), so I guess it uses mostly native controls.

If you want a commercially supported cross platform toolkit, then try Qt from trolltech. This has (to me at least) a rather strange paradigm, but it must work well enough as it underlies the KDE desktop. You can get an open source version or a licenced version to suit your taste.

David Roper
Thursday, September 18, 2003

If you choose not to use OSS for political/social/emotional reasons, that's fine.  But don't avoid it because you misunderstand the license. 
http://www.sitepoint.com/article/415
http://linuxtoday.com/infrastructure/2000123100604OSCY

Simply stated, if I change BASH, the interpreter or one of the modules, I am required to release my changes back to the community.  If I write a BASH script, that is not a derivative work.  No more than MS would own Tom Clancy's novels because he typed them in their word processor.

Like you this is not to start a war, merely remove a misunderstanding...

MSHack-- IANAL but I may play one on TV
Thursday, September 18, 2003

wxWindows is a class act all the way.

FullNameRequired
Thursday, September 18, 2003

Please explain why the LGPL it was created for the C runtime library used by GCC if the GPL is good enough.  I've been using OS since 1995.  I have a pretty good idea how it all works. 

If someone is willing to explain the differences between writing a shell script and linking to a library to a judge, more power to them.  In the mean time I refuse to link to GPLed libraries.  In my opinion the difference between linking to a library and using an OS interpreter to run code is signficant.  But it would take a pretty inspired judge to understand the difference.

christopher baus
Thursday, September 18, 2003

I didn't really mean to get into the OS battle once again, but...

I probably wouldn't work on OS code myself, but if free tools exist, I'm going to use them, or someone else will and outperform me in the market.  I believe judicious use of OS makes me a much more valuable commercial software developer.

christopher baus
Thursday, September 18, 2003

Have a look at FLTK.

It's LGPL, with exceptions that say static linking is a-ok, so basically, and that new GUI classes are not considered derivative works, so unless you insist on modifying the core, it's much like BSD for you.

It's fast; It's easy to use (easiest GUI toolkit I ever used - most GUIs come out 2-5 times shorter); It's cross platform - Win, X, OS X; It has very good documentation and an extremely responsive community.

The entire FLTK, statically linked, is ~200k, and that includes an amazing variety of widgets. A statically linked "Hello world" button was ~40k last time I tried. The 200k includes a fast, simple web renderer (useful for displaying help, and perhaps reports; It doesn't support javascript or frames, though). The 200k also includes a cross platform file chooser with completion and easy-to-extend preview. Edit fields, buttons, scrolls, dials, tabs, list boxes, menus and many others are, of course, included as well. (A grid is not available as part of the distribution, but an excellent, superfast implementation called Fl_Table is available).

FLTK interoperates with everything; Unlike other toolkits, it does not insist on running the show (although it will run the show if you let it, which is often the case).

It has a very powerful GUI designer, that is a bit nonstandard as far as GUI designers go. But it's EASY to programmatically create forms, and in fact, the GUI designer's output is a program.

It has some theming support, and strict cross platform compatibility, so it can look exactly the same on all platforms, and at the same time looks native on each platform (including, for example, importing the user's color preferences, which some toolkits neglect to do).

It comes with many useful example programs.

It integrates very well with OpenGL, should you need it.

It has good support for platform specific implementation; Should you need the HWND / Window / Drawable, it's available without much hassle.

You can select single or double buffering. Don't you find it absurd that WinHelp _still_ flickers horribly when you resize the window on some files (e.g. Project 2002; It doesn't flicker on all files though, I have no idea what causes the flicker)?  In FLTK, you just specify double buffering and ALL FLICKER WHATSOEVER disappears, regardless of how much overdraw your redrawing causes.

A grid widget, seamless unicode support and printing facilities are available outside the standard distribution, if you need them.

The programming model is slightly different than the common standards, but it's different in a good way. It's well worth spending the time getting familiar with it, rather than discarding it on first sight as many do (A common response is "ooh, it sometimes uses globals! that's horrible". It isn't horrible. In fact, FLTK programs are much easier to write and read than, say, MFC or wxWindows programs that have no global state).

[ http://fltk.org ]

Ori Berger
Thursday, September 18, 2003

Christopher, regarding OS code - if you rely on OS code in any significant way (which, as you mention, is economically very efficient), you'll _WANT_ any extensions / bug fixes you do to go into the standard distribution, because otherwise you'll have to maintain your own branch.

GPL tries to enforce it, but most BSD projects eventually get most of the patches / bugfixes / enhancements contributed back because of this.

Ori Berger
Thursday, September 18, 2003

i've used wxWindows, and it is about as good as it gets for cross platform UI. that said, you should be wary of insisting on cross platform anything. i've seen over emphasis on "cross platform" derail 3 projects by years, and completely destroy one company.

it is far easier to write the application for one platform and then pay some russian offshore team to port it to another platform, if you decide it is important to support more than one.

the only successful cross platform project i have seen is Reason from propellerheads. and they pretty much just write everything in straight up C++ with no reliance on outside toolkits.

rz
Thursday, September 18, 2003

Ori,

That's true, but if I want to make proprietary changes to the core and not release the changes BSD allows me to do so.

christopher baus
Friday, September 19, 2003

Photoshop ring any bells?

christopher baus
Friday, September 19, 2003

I understand that being 100% cross platform is insanely difficult.  My guess is the offshore team would have to do a complete rewrite if I used something like Win32 directly to write the UI.  Using something like wxWindows makes it possible to have a fighting chance to have one code base.  I might still outsource the ports, but I'd rather the program could compile from one code base even if it is #ifdefed to heck.  Having a complete fork would be a nightmare.  Not going there.

christopher baus
Friday, September 19, 2003

You ask if people like wxWindows, and we all seem to.

You make a few comments about GPL, claiming not to want a war, and you get a war.  What a surprise :-)

I am just surprised that the wxWindows bit didn't promote a holy war too (nods to the guy with the other toolkit).

Personally, I dislike anything as unrobust as 'message maps' in my source; languages like Object Pascal nicely hide such messes and let you get on with the real code..

(And I'll claim I'm not trying to incite a C++ vs xyz holy war ;-) )

i like i
Friday, September 19, 2003

I've just too many opinions for my own good.  The message map craziness is something I've learned to live with through years of using MFC I guess.  I might consider one of the other language bindings.  In the end the UI needs to interact with a bunch of C++ code though. 

christopher baus
Friday, September 19, 2003

I have not used wxWindow myself, but others I know have and they where quite satisfied. The only used and tested it on W2K.
The "portability", as in many cases, was basically just a feature checkbox that nobody ever intended to actualy test or make use of. I have also seen this happen in other projects. I wonder how common this situation is.

Just me (Sir to you)
Friday, September 19, 2003

http://www.fox-toolkit.org/
"FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as OpenGL widgets for 3D graphical manipulation."

http://www.gtk.org/
"GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
Unix, BeOS, MacOS X, Win32

Nekto
Friday, September 19, 2003

GTK is not stable on Win32 and looks crappy, so that is out.

christopher baus
Friday, September 19, 2003

One of the critical factors I'd consider in deciding which of the three main GUI toolsets is appropriate is the kind of application.

If the presentation of the app is going to benefit from a mixed XML/HTML content and there's significant use of network services and local security then I'd strongly consider XUL.

If the app was relatively small and straightforward then I'd probably prefer wxWindows with whatever language interface made sense.

If the app was going to benefit from existing components in beans then I might reluctantly accept that Swing was the way to go.

Simon Lucy
Friday, September 19, 2003

This is for a network application.  Please see my thread on network threading architectures.  Same app.  For this reason I wanted to make extensive use of XUL, but then realized Necko doesn't support server sockets, and it looked like a pain to add.  So the core networking code uses ACE which is a really nice middle wear architecture.  Now I'm looking for UI toolkit.  It honestly isn't as important if the UI runs on anything other than Windows, but the core network code MUST be cross platform to at least POSIX systems.

christopher baus
Friday, September 19, 2003

TCL/TK ?
http://resource.tcl.tk/resource/software/ports/
+ win32 from ActiveState

Actually just a "TK" library for GUI

Nekto
Sunday, September 21, 2003

*  Recent Topics

*  Fog Creek Home