WX Widgets – a GUI library for programmers


03 Jan  

Before I moved onto java programming, I had difficulties while doing GUI for my programs (especially those written for scientific computing). This edition is about a library that is handy for anyone who had the similar difficulties I faced – It’s about wxWidgets!

WxWidgets is essentially a cpp (C++) library that allows developers to develop GUI for programs they had written in C++, Python (using wxPython), Perl or Ruby. You may note that the library is not performing a GUI emulation but is using the platform’s native API.

You can build applications for Windows, GNU/Linux, other *NIX, Mac etc using this. You can also have 32-bit and 64-bit variants of your program. Another interesting feature is that the library also offers support to programs written for iPhone SDK and Windows Mobile.

 

 wxWidgets logo

 

The most striking feature of the program is its cross-platform compatibility. As I mentioned before, a wide range of platforms are supported by the library. The feature that I like most is that it allows developers to cross-compile MS Window specific applications without leaving my GNU/Linux environment.

Since the library is open source, you can improvise it further so as to suit your requirements. And, more importantly, you need not worry about the licensing side when it comes to commercialisation of your program (specific to the use of this library).

You can find a reference manual (a very large document!) and samples in the library’s website. You can see that the developers have illustrated the use of API using different sample applications.

You can easily add basic GUI elements like bitmap buttons, text entry, checkbox, scrolling list, combobox etc using the library. The library also comes with a very powerful event system (and a non-standard preprocessor is not required in this case!) . The solution also has a good print (preview) mode which allows users to view.

 

GUI elemts - wxWidgets

 

If you are developing a big application, then you may find the inbuilt debugging tools of the library quite handy. And you can use any standard C++ (in Windows you can try Cygwin or Mingw32, as I find these to be better than Visual C++ and Borland C++ for your standard programs) compiler for building it.

Another useful thing is that the library has a set of ODBC classes which enables you to meddle with the database. You may also find the support for clipboard and drag and drop utility quite useful. You can use ‘UI update events’ for coinfiguring the application’s response to a particular event generated. You can also control menu using this.

Network programming is supported by the library so that you can handle protocols like FTP or HTTP. You may refer to the TCP/IP specific files in the library for more details.

Interestingly, it allows the developers to put formatted text in the ‘about the program’ box! You can also display ‘help files’ within your program itself. Using a wxGLCanvas  pack, you can enable the support for OpenGL as well.

The picture shown below shows an application that uses the extensive Object Graphics Library . This library (supported by wxWidgets) allows you to implement CASE tool. You can also model networks using this.

 

wxWidgets based apllication using graphics library

 

The only issue that I found with this library is that it is not good for developers who pivot their application around structured storage or ActiveX. But for others, it worth giving a try!
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Tags: , ,


TechBlog on Facebook

Leave a Reply