noahgibbs: Me and my teddy bear at Karaoke after a day of RubyKaigi in HIroshima in 2017 (monkey scientist)
noahgibbs ([personal profile] noahgibbs) wrote2004-03-10 05:19 pm

More geeking...

I'm looking at writing some simple cross-platform GUI stuff, probably in C. Well, probably in C++ since all the decent cross-platform GUI libraries seem to require it.

Other than FLTK (which looks pretty good) and GTK+ (which sorta works on Windows, but it's not clear how well), anybody got any recommendations for a toolkit that will do (at a minimum) Linux and most common Windows flavors?

[identity profile] terpsichoros.livejournal.com 2004-03-10 06:22 pm (UTC)(link)
I'm not a programmer, but I know that Qt is available for both Windows and Linux. Opera uses Qt, and runs quite nicely on both.

[identity profile] bredmold.livejournal.com 2004-03-11 12:22 am (UTC)(link)
The only real GUI toolkit I've ever used was Tcl/Tk. I haven't used it in a Very Long Time, but I found it to be of similar difficulty to writing web applications. It doesn't particularly complicate simple tasks, which is nice. The most common complaint about the whole thing is that you have to use Tcl for at least part of your application. Last I checked (a long time ago), there were people maintaining various non-Tcl bindings for Tk. Perl and Scheme come to mind as the two main ones. The guts of Tcl and Tk are coded in straight C, unless it's been changed recently. The core system is free and has been ported to Windows, Unix and Mac, at the least.

Hope this helps.

(Anonymous) 2004-03-11 11:55 am (UTC)(link)
FLTK is okay. It's small and fast in the way that GUI toolkits should be. Their commitment to static linking makes me happy. It's been quirky for me on Windows (compiled via cygwin), but I don't know how indicative that is. Maybe it works great when compiled with VC++.

By the way, I can't get myself to stomach FLTK because I really hate its callback system. Specifically, callbacks are C function pointers, which means they can't point to non-static methods. If your code is likely to be OO, you'll find yourself writing static methods that decode void pointers and then call the methods you really wanted to call in the first place.

I really favor typesafe callback systems that know how to connect to either methods or functions. gtk-- has one, encapsulated in libsig++. It looks decent, but I swallowed the C++ template pill long ago. I'm a bit leary of gtk--, since it's just a C++ wrapper around gtk+. Side projects that try to keep alternate interfaces to active projects scare me.

Qt is very highly regarded in its cross-platformness, but as you say, it's not as free on some of the platforms, which makes it, in effect, not cross-platform. It does have a nice callback system, but it forces you to run a preprocessor on your code.

There's nothing out there that makes me happy. You're less unreasonably picky than me, so maybe you'll see through the flaws and find something that works. If you do, lemme know.

(Anonymous) 2004-03-11 11:56 am (UTC)(link)
Oops. The "me" in "lemme know" is tdl.

[identity profile] xarnix.livejournal.com 2004-03-18 08:20 pm (UTC)(link)
It flagrantly ignores the desire to use C, but for sake of mentioning it, SWT is a Java-based graphical interface toolkit that does a surprisingly good job on a number of platforms. If you like Java, of course. Interfacing C with it would be... circuitously icky.

Whatever happened to the toolkits of yore? Amulet, SUIT, ...

I've got no particular recommendations on C toolkits, unfortunately. GTK always seemed halfway reasonable, but I too am ignorant of its current state on Windows (or MacOS X, for that matter.)