Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

WxPython in Action 77

aceydacey writes ""WxPython in Action" is a new and definitive guide to the popular wxPython GUI framework. WxPython has been growing in popularity by leaps and bounds in recent years but has been hampered by a comparative lack of good, comprehensive documentation, so much so that many people have turned to studying the documentation for the underlying wxWidgets framework, that is written in C++. "WxPython in Action" fills the void by combining a good introduction to the framework with a comprehensive and accessible reference document. At 552 pages, Manning Publications has produced a definitive book." Read the rest of Ron's review.
WxPython in Action
author Robin Dunn and Noel Rappin
pages 552
publisher Manning
rating 10
reviewer Ron Stephens
ISBN 1-932394-62-1
summary An introduction to the WxPython GUI Framework


WxPython is one of the best cross-platform GUI toolkits for the open source Python programming language. It excels in matching the native look and feel of programs on Windows, Linux, and Mac OS X. It is a mature project, being a well-developed wrapper of the underlying wxWidgets C++ toolkit. Another reason for its growing popularity is its very extensive number of widgets, making it a capable and modern tool for making professional-looking GUIs for applications in almost any field of endeavor. It has endured a reputation for having a steep learning curve, and for sometimes being difficult to install and easy to break during upgrades; both of which downsides should be lessened by the publishing of this book.

Written by Robin Dunn, the creator and moving force behind wxPython, and ably assisted by Noel Rappin, this book is definitive, authoritative and well-written. Part 1 fills the role of a good introduction to the toolkit, and Parts 2 and 3 are a thorough reference to the widgets, behavior and usage of the framework.

in Part 1, we learn the inside story behind the beginnings and the history of wxPython's development. We are walked through the creation of simple examples of the core functionality of the framework illustrating how to create and use the basic controls and event loops. Then, we get a more detailed explanation of the wxPython event loop, an introduction to PyCrust (a useful tool for wxPython programmers, essentially an interactive interpreter session, wrapped as a wx widget) a whole chapter on the Model-View-Controller paradigm, and a discourse on good factoring techniques for GUI programs. This is rather general programming knowledge, not necessarily specific to wxPython, and truly expert programmers will probably skip much of this material, but for many, like me, it is very useful, and for many others, it will be a good review of previously known material. The writing style is excellent but one weakness is that the authors return again and again to wxPython evangelism and boosterism, which is regrettable; but this is the only section of the book to suffer from this flaw.

Part 2 gives detailed coverage of each widget, control, frame, dialog, and menu in the toolkit, and this is the meat of the book and will be used and reused as core reference material by many a programmer. This is good stuff, thorough, well researched, and definitive. Next, the authors give an equally good explanation of how to use sizers and grids to layout and control your GUI application. Part 2 fills the previously missing gap in core wxPython documentation and, to folks who need it, is worth its weight in gold.

Part 3, called Advanced wxPython, gives welcome coverage to advanced layout and control issues. This subject of advanced layout is, in my opinion, where the rubber really hits the road in GUI design, and it is appropriate that this is where the authors spend the most time and effort, and with good result. The final chapter breaks new ground by walking the reader through the creation of a multithreaded wxPython application. This is great stuff, and the advanced readers will be left pining for even more on this timely topic of such growing importance. Fortunately, the authors are available online to communicate with users who truly master the material in the book and want to to pursue more advanced usage.

The book is at its best in documenting the core API for expert programmers who are new to wxPython. It is also a good introduction to wxPython for advanced programmers. For moderately experienced programmers, the book is excellent but will be a tough read; probably not to be mastered in a straight read thorough, the book will adequately reward this kind of reader who is dedicated and persistent. For novice programmers, especially those who have little to no previous experience in GUI programming, I believe the book may be beyond their grasp.

So, if you are a serious programmer who wants or needs to use the wxPython GUI toolkit, "wxPython in Action" is a must-have reference book. It is perfect for this kind of reader and will become a well-worn book that will be useful for at least the next five years. It is unlikely that any other book about wxPython will be published that could do a better job, given the authors' unparalleled understanding of the toolkit and the obvious patience, time and care they took in researching, writing, and editing this book. It is not a casual read, but to a serious student of the subject, that is a positive statement. The book is strong meat, a weighty and substantive technical tome.

The book really shines in the many pages devoted to User Interface design and implementation. This is where many programmers need help, and it is gratifying that this book goes into the most detail on this subject. This is very detailed coverage and one is left with a satisfaction that, while not easy reading, it is well worth while. I feel this is the book's strongest point.

I know that it sometimes seems there has been an inflation in the scoring of books, with reviewers giving so many high ratings that one wonders how meaningful those ratings are. This book is not for everybody, and it is not a work of great literature, but given the obvious need for such a work, and the careful and accurate fulfillment of this need by these authors, I feel justified in giving it a rating of ten stars. For the people who really need this book, it is about as good as it could get, and will be a most welcome addition to their technical library.

More material for those learning and using Python can found at my web site Python Learning Resources.


You can purchase WxPython in Action from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

WxPython in Action

Comments Filter:
  • by RyanFenton ( 230700 ) on Monday July 10, 2006 @04:26PM (#15693538)
    I've been planning an opengl project with a GUI in it for image editing, using Python for scripting. Would it be possible/plausible to render from from a GUI toolkit like wxPython into a texture to load into opengl, so that the window could be part of a world, rather than enclosing an OpenGL widget into a wxWidgets/wxPython framework?

    Ryan Fenton
  • Re:About time (Score:2, Interesting)

    by LaissezFaire ( 582924 ) on Monday July 10, 2006 @05:37PM (#15694017) Journal
    Unfortunately PyGTK is slow and buggy (crashes) on Windows, as the good folks over at http://www.gajim.org/ [gajim.org] have discovered. It makes it less useful cross platform, though on linux it runs well.
  • Re:Python wrappers (Score:1, Interesting)

    by Anonymous Coward on Monday July 10, 2006 @05:44PM (#15694061)
    If you know Python at more than a novice level, you can learn from the C documentation and just adapt it all for Python.

    I think if you are moderatedly competent with any language you should be able to do so. I didn't know Python or C/C++ and was easily able to use the wxWidgets docs to create wxPython apps.

    As long as the wrapper syntax is logical and consistent in its differences from the underlying library, you really don't need a special function reference for the wrapper.
  • by Profane MuthaFucka ( 574406 ) <busheatskok@gmail.com> on Monday July 10, 2006 @09:11PM (#15695176) Homepage Journal
    Not my experience. I found wxWidgets in general to be full of bugs, to the point where the display errors I was getting were making it impossible to use. For example:

    1) fill a tree widget with a few thousand items. You've got lines going everywhere.
    2) The latest library upgrade screwed with the layouts so that what formerly used to fill the entire window now filled only the upper left corner.
    3) The date widget screws up every time there's a daylight-savings change. If the change happens on April 1st, the date selection widget will display March 30. On April 2nd, it's working again.

    That's just three, but I've seen many more. By comparison, I'm very experinced with Swing, QT, MSFC, and Tk, and none of those displayed the kinds of problems that I saw with wxWidgets.

    And when I say wxWidgets, I mean the library in general. I've programmed all of the above GUI libs mentioned in multiple languages, and wxWidgets behaved with similar bugginess in wxPython too.

    The wxPython API definitely does rock, but there's a lot of bugs. I tried to dig through the code to see what was going on, and I found that to be a huge mess too. I've been through the Qt code, and it's pretty well organized and definitely well written. wxWidgets appeared to be due for a refactoring and cleanup to make it easier to work on.

It is easier to write an incorrect program than understand a correct one.

Working...