OOP Newbie mixing COM, wxPython, BOA

Mojo mojo at geofinity.com
Tue Feb 12 22:10:48 EST 2002

"Jeff Shannon" <jeff at ccvcorp.com> wrote in message
news:3C687007.4ACF94EE at ccvcorp.com...
> What you should do, is instead of making the Jabber object be global to
> VpFrame module, you should encapsulate its creation into a function.  Have
> frame call this function in its __init__(), and then save the reference on
> frame.  At this point, you will also want to stick a reference to the
frame onto
> the Jabber object.

Yep, that did it.   I kept thinking of the Jabber Object as a literal COM
object and immutable (interfaces as API).  It might never have dawned on me
that it was actually a python object, and that I could add an attribute at
runtime.  Once my head stopped spinning, it made perfect sense.  Thanks a

>... In fact, you might
> look at defining custom wxPython command events, and having the Jabber
> notify the GUI by posting those events. (This is a somewhat advanced

I've got some basic functionality to test first, but that is exactly what I
want to try next.

> Also, by having both objects holding references to each other, we've
created a
> reference cycle.  Python's garbage collector should be able to handle this
> but just in case, it's probably a good idea to explicitly destroy the
> object in your frame's OnCloseWindow() handler (or whatever name is given
to the
> method that shuts down your frame).  But it's a common idiom in wxPython
> parent and child windows to each have references to the other.
(Typically, the
> wxWindows framework will clean up child windows for you, but obviously
> knows nothing of your Jabber object...)

Will do.  I appreciate the advice and explanations.  Now, I'm off to make a
bigger mess...

Thanks again,


More information about the Python-list mailing list