C++ For Easy GUI Development

The Desktop GUI development space has been owned by Borland and Microsoft pretty much since that space existed. The free software world has started to catch up though. Four packages have combined to make an excellent development environment for GUI applications.

The first is MinGW, a Win32 port of the gcc compiler that dominates the UNIX world. Unlike the Cygwin tools, MinGW builds a native application that doesn't require any compatibility libraries like Cygwin does. Although it lags behind the main gcc distribution, it's quite well supported by distributed open source software packages, making it easy to build software using common open libraries.

The next is wxWidgets, a cross-platform GUI library that is easy to use and creates applications with native widgets. That means that on UNIX the application looks like any other GTK+ application, and on Windows it looks like a Windows application. It is well supported, and ships with a large number of examples so that you can see how to use the library.

Code::Blocks is an IDE that uses wxWidgets and most common C and C++ compilers, including MinGW. Code::Blocks was designed to be cross-platform, so it takes care of most of the issues involved with cross platform builds, including generating the proper build sequences for applications rather than relying on Makefiles. It also integrates well with wxWidgets, so that it will work out the right paths and libraries based on your actual installed wxWidgets.

wxFormBuilder is the final player is this quartet. It is a RAD GUI designer for wxWidgets. Like the GUI designers from Borland, it is very easy to drop controls on the form and hook them up to actions in code. It's also very easy to extend with new components, without requiring that the component be somehow installed or registered with the GUI tool. That has always been a serious problem with Borland's development model, and a problem that I am very happy to see solved. It also integrates well with Code::Blocks.

This doesn't mean that people are going to be throwing out their copy of Delphi or Visual Basic. But it does mean that when I want to write a nice looking GUI program, I've got a new and very excellent tool handy. Having written major applications in Delphi and Visual Basic in the past, I know that they can do very nice things. I also know that they have a lot of limitations. Using C++ and these tools I get the ease of use I enjoy with Delphi, but have the power of C++ handy. For me, a dedicated C++ developer, this is a very happy situation.


Hi, Nice article. I see you

Hi,

Nice article. I see you use Code::Blocks - can you write a few words about it? How good is it?

I did a lot of programming on Win & Mac, but I am total linux noob so I installed Anjuta on my Ubuntu recently and now I'm thinking about Code::Blocks.

Should I try it?

Igor


Code::Blocks for Unix dev

Clay Dowling's picture

For the most part I keep it old-school on UNIX, using emacs or vi for simpler projects. For GUI dev though I always use Code::Blocks. I like it a lot as a good way to manage my files and flip back and forth between the easily. The wizard for setting up wxWidgets applications is very nice as well, and the tool couples well with wxFormBuilder. In fact, the pairing of Code::Blocks and wxFormBuilder has become my favorite way to program GUI apps for any platform, Linux or Windows. Since I regularly use Delphi for my windows dev, that's saying something.

Clay Dowling
http://dowling.lazarusid.com/blog/1


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options