pubsub necessary in this case?

wx.lib.pubsub is almost the easiest way to do it.

You can of course define the methods in your second wxFrame (or first)
and benefit from Python's runtime binding to simply look up if the
methods are there, but that leaves you with sharing frame pointers as

This is just what I don't know how to do. Could you elaborate?

wx.lib.pubsub is a wonderful way to subscribe unknown objects to
messages. This allows to tie the data layer which should know nothing
about the GUI, with the GUI layer.

Simple example;

---------
# your second frame
from wx.lib.pubsub import Publisher

Publisher().sendMessage( ("yourclass", "yourmessage"), additionalData )
---------

---------
# your main frame
from wx.lib.pubsub import Publisher

Publisher().subscribe(self._onReceived, ("yourclass", "yourmessage") )

def onReceived(self, msg):
    additionalData = msg.data
----------

In your case maybe for a one time communication a method might
suffice, but i am always a strong believer of a clean separation in
favor of reusability, or seperation when no dependencies should exist.

Thanks for the example, and I will look into trying pubsub, too.

ยทยทยท

On Thu, Apr 10, 2008 at 2:34 AM, Jorgen Bodde <jorgen.maillist@gmail.com> wrote: