Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

December 18, 2002

Embedding PyCrust in a wxPython Application

I wanted to quickly add a PyCrust shell window to an application I was working on. But looking at the documentation I couldn't find a simple (enough for me) example stand alone application.

So I wrote one. With many thanks to Kevin for actually getting the thing to work and Patrick for writing the thing in the first place. Have a look at If your browser has problems displaying the text you can download the Python code here.

To run this code you need Python and wxPython installed.

The thing that confused me, and that wasn't immediately obvious from the code and examples about, was how to structure the different elements of the application.

As you can see the correct order is application (myApp), which contains an operating frame (myFrame) which contains the shell frame (PyCrustFrame). But, when you create the shell frame you pass it a reference to your application object in the parentApp parameter. Simple.

Posted by Andy Todd at December 18, 2002 11:36 AM