One of the interesting frameworks the Python programming community provides is an open source graphical user interface (GUI) framework called wxPython. Like other GUI frameworks, wxPython has an extensive library of widgets and controls for building windowed applications. In addition to this, wxPython gives a programmer the ability to write one GUI application that will run on all three major operating systems: Microsoft Windows, Mac OS X, and Linux. Not only that, but depending on what platform the code is running, it will automatically morph itself to the look and feel of that platform.
While this technology is exciting, learning how to use it is an entirely different matter. As anyone who has tried to use wxPython knows, the documentation for it is rather sparse. So much so, that the recommended approach seems to consist of copying code from examples within the wxPython distribution, and then coding and experimenting with it to divine the inner workings of all its parameters and effects. This approach was way too tedious and time-consuming for me, so I put off learning this corner of Python - until now.
Recently this subject has finally gotten its due, thanks to a book and ebook published by Manning Publications entitled wxPython in Action. The book was written by Noel Rappin and Robin Dunn. Noel is a senior software engineer for Motorola, and Robin is the creator and maintainer of wxPython; two people who have had extensive experience using and supporting the wxPython platform.
The book is divided into three major parts: the first gives an introduction to the basic structure and function of a wxPython GUI application. It looks at some of the basic widgets, discusses the principles of event-driven programming and explains the use of a tool called PyCrust to analyze GUI-based applications. The first part also outlines the use of the Model/View design pattern, and looks at re-factoring and testing GUI applications. Part 1 then ends with a step-by-step development of a sketch pad application.
Part 2 gives more detail about the implementation and use of the GUI elements briefly discussed in Part 1. Separate chapters are devoted to basic controls (ie. text boxes, buttons, etc), standard frames and dialogs, and GUI layout and drawing.









Article comments