noahgibbs: Me and my teddy bear at Karaoke after a day of RubyKaigi in HIroshima in 2017 (monkey scientist)
[personal profile] noahgibbs
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?

Date: 2004-03-10 06:22 pm (UTC)
From: [identity profile] terpsichoros.livejournal.com
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.

Date: 2004-03-10 06:23 pm (UTC)
From: [identity profile] angelbob.livejournal.com
Unfortunately, Qt isn't free on Windows.

Date: 2004-03-10 06:35 pm (UTC)
From: [identity profile] terpsichoros.livejournal.com
Darn that requirements creep!

Date: 2004-03-10 06:41 pm (UTC)
From: [identity profile] angelbob.livejournal.com
Heh. Yeah, if money weren't an object I could probably do better than the free stuff. 'Course, I'm also much happier being able to debug properly, and that's usually difficult with something you pay money for. They don't like you nosing through their code. One of the few ways to make C++ significantly *less* debuggable than it already is :-)

I'm already less than thrilled that I'll probably wind up needing to pay for a Windows compiler. Yes, Cygwin exists, but it's not likely to be the most common case among Windows folks...

Date: 2004-03-10 06:49 pm (UTC)
From: [identity profile] angelbob.livejournal.com
Oof! I checked their web page. Since there's no GPL'd version of Qt for Windows, I'd have to use one of the regular commercial ones if I wanted to be able to distribute apps (even for free) legally.

That's a minimum of $1550. Ouch! And that's if it takes me a year or less to finish everything I'll ever do on the app.

So yeah, that's not really an option.

Date: 2004-03-11 12:22 am (UTC)
From: [identity profile] bredmold.livejournal.com
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.

Date: 2004-03-11 06:07 am (UTC)

Date: 2004-03-11 08:39 am (UTC)
From: [identity profile] angelbob.livejournal.com
Sadly, it never worked on Windows. :-)

I actually gave up on Spiral when I found glib (part of the underpinnings of GNOME). As it turns out, they'd already done essentially everything I was doing with Spiral, and they maintained it without any effort on my part.

Sadly, GTK+ isn't very portable to Windows. There's a port, but it's apparently quite quirky, and it's way out of date.

Date: 2004-03-11 11:55 am (UTC)
From: (Anonymous)
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.

Date: 2004-03-11 12:00 pm (UTC)
From: [identity profile] angelbob.livejournal.com
You're less unreasonably picky than me,

Bwah-hahahahaha!

Um, I mean, that's kind of a matter of opinion.

The other big possibilities that I've seen are the FOX toolkit and wxWindows. Haven't looked into either one enough to know whether I'll like it, though early signs on wxWindows aren't promising.

Date: 2004-03-11 03:51 pm (UTC)
From: [identity profile] msde.livejournal.com
I think wxwindows was what my coworker used. It was a huge pain in the butt, because he used it just so he could program in C. The rest of the project was VBA. It did seem to handle basic gui components tolerably well though.

Hmm. a couple minutes with google suggests that wxwindows is the way to go if you already have a code base written using MFC. My suspicion is that writing for windows with the intent of porting to linux might be the way you have to go.

Whoops! Now that I think about it, I think he was using wxWidgets. http://www.wxwidgets.org/ I remember him complaining that it was a huge library and he wasn't able to just use part of it.

How complicated is the gui going to be? It might be easier to just write two?

Date: 2004-03-11 10:55 pm (UTC)
From: [identity profile] angelbob.livejournal.com
The GUI won't be too complicated, but maintaining two mostly-seperate versions would be kind of a pain... We'd be talking complexity on the order of the LiveJournal web client -- so, y'know, big but not all that complicated.

wxWidgets is apparently just a rename of wxWindows. So it's basically the same thing. Yeah, it looks like a pain for that reason among others.

I actually have barely used MFC before, but I was distinctly unimpressed. In any case, this'll all be written from scratch unless I find something similar to base it off. I'm not optimistic about finding such a thing.

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

Date: 2004-03-18 08:20 pm (UTC)
From: [identity profile] xarnix.livejournal.com
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.)

Date: 2004-03-18 10:04 pm (UTC)
From: [identity profile] angelbob.livejournal.com
GTK+ is pretty precarious on Windows, it turns out. Sad, really. And the rest of GNOME is essentially not there at all.

Amulet, if memory serves, was horrendously, painfully slow. Don't know SUIT offhand.

SWT is, as you say, Java. As it turns out, that mostly disqualifies it from the application I have in mind by itself. Aside from questions of portability (where C is no better) and performance (which aren't totally crucial), there's the fact that a lot of the code will be implementing a network protocol on top of TCP/IP. While I keep hearing how good Java is for dedicated network applications, my memories of its network stuff aren't fond. Perhaps there's some easy way to do it that I'm missing.

But yes, I'm no friend of Java's. It's possible that my experiences have all been bad because I've been looking at Unix stuff mostly, and on hardware-constrained systems (not Java's strong point). But so far, I'm very deeply unimpressed with Java, and the idea of trying to get a nice, crisply-responsive application that does anything beyond telnet in that language just isn't appealing.

Date: 2004-03-18 10:48 pm (UTC)
From: [identity profile] xarnix.livejournal.com
Shoot, now I want to help work on Gtk+/Windows -- that's right up my skill-set.

For deeply embedded stuff, I suppose I should point out http://www.amulettechnologies.com/. There have been similar things over the years, but honestly most aren't much more than anyone with a bit of knowledge of Perl, HTML, and serial communications could put together.

Borland has put a lot of effort into wxWindows -- I'd assume it is usable.

(Incidentally, Keith used fltk with POSE, and it wasn't too bad -- but then POSE didn't need much in the way of its own GUI.)

Date: 2004-03-19 07:27 am (UTC)
From: [identity profile] angelbob.livejournal.com
Hm. I'm actually planning on doing this for a desktop app, so the link you gave doesn't quite work -- I'm guessing that dedicated processor chip is hard to fit through a 10BaseT cable :-)

wxWindows (now wxWidgets) is currently my most likely choice. The runner-up is FOX. wxWindows is a little older, better documented and better developed, and has more GUI builders available, which is nice. But FOX is overall pretty comparable.

GTK+ was one I really wanted to consider, but it's just not at that maturity level. And Qt winds up costing $1500+ per year to use on Win32, so screw that :-)

FLTK isn't bad. I have a definitely preference for a lib that uses the local widget set and builds on it rather than building its own, which is probably the only reason it wasn't selected.

December 2024

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 5th, 2025 05:31 am
Powered by Dreamwidth Studios