Despite all the progress Linux has made in recent years there are still some areas woefully lacking. Gaming is one such area, though this is always improving and is really down to lack of vendor support, and another is GUI programming.
“What about Gtk?!” I hear you, um, type. “What about Qt? wxWidgets? Tk? Good old xlib?”. Well yes, those are all wonderful GUI toolkits (well, maybe not xlib and Tk is aging a bit now) that do a great job of providing the user with widgets to make programs user friendly, but actually *implementing* a GUI in any one of these toolkits ranges from tedius to downright difficult.
I need a GUI for a level editor for a game I’m making so I sat down to look for the right toolkit. I dismissed Gtk in its C form outright because I’m not a C programmer and programming in C requires a different mindset and approach to a problem than does C++ (my usual language of course). Instead I looked at Gtkmm (Gtk Minus Minus), a C++ wrapper for Gtk. And yes, it’s got a very nice object oriented abstraction of the C implementation. It’s also woefully badly documented. The tutorials show you how to set up a window, but from then on every example seems to only show part of the necessary code and information to acheive the desired result. So I looked at Glade, but the XML it produces strikes me as ugly and cumbersome.
So, moving on I thought about Qt. After all, it’s designed with C++ in mind, surely this would be easier to use? Well, yes and no. Getting something together in Qt is fairly easy but then the interface has to be pre-compiled with a meta object compiler before you can use it in your C++ program. It’s not that much of a deal, but it’s an annoying intermediate step.
All this reminded me of the reason I usually write my small GUI tools in Java – the ease of putting a simple GUI together by hand. I’m so used to Java that I can knock a GUI together just using a text editor in a few minutes. The problem with Java is that the event handling in Swing is so clunky: having to set up ActionListeners to check for button presses is unwieldy, and besides, I want to save my files in binary format, which in C++ is simply a case of writing the objects directly to file. It might be the same in Java but I’ve never done it, so that’s another obstacle.
Compare this to Windows where so many drag and drop IDE’s exist. At work I use Delphi and nothing could be easier for developing a GUI: I drop widgets and link the events in code in the same program and in an intuitive way. No ugly XML, no manual packing of widgets in code.
What’s needed, dare I say it, is a tool comparable to MS Visual Studio in Linux. It’s not that I’m not capable of putting GUI’s together manually using something like Gtk, but it’s not a very productive use of time when what I could really be doing is the behind the scenes logic. I.e. the important stuff.


