Inter process comms.

I have a wxFrame containing a wxNotebook with several pages containing wxListCtrl’s (for browsing table data)
I activate another wxFrame from one of these pages. On a certain event (double-click) I want to set focus to the first wxFrame and select a certain page from the wxNotebook. Thereafter I want to pass selected information back to the second wxFrame and set focus to the window again.

Question: How can that be achieved? Should I pass references to parent windows throughout my app. or should I use threading instead?

Many thanks,
Tertius

Hi All,
I found the GetParent() and GetGrandParent() methods which makes the first SetFocus() and notebook1.SetSelection(page)
possible. Question now is how do I know which windows to pass control back to (re-focus) once I'm done?

TIA
Tertius

tertiusc@netscape.net wrote:

···

I have a wxFrame containing a wxNotebook with several pages containing wxListCtrl’s (for browsing table data)
I activate another wxFrame from one of these pages. On a certain event (double-click) I want to set focus to the first wxFrame and select a certain page from the wxNotebook. Thereafter I want to pass selected information back to the second wxFrame and set focus to the window again.

Question: How can that be achieved? Should I pass references to parent windows throughout my app. or should I use threading instead?

Many thanks,
Tertius

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Tertius Cronje wrote:

Hi All,
I found the GetParent() and GetGrandParent() methods which makes the first SetFocus() and notebook1.SetSelection(page)
possible. Question now is how do I know which windows to pass control back to (re-focus) once I'm done?

WIthout knowing more about the structure of your program all I can say is "however you want." :wink:

Perhaps a different approach that would help you is to use something like the pupsub module in the library, or other Observer pattern modules floating around out there. Then you can allow different parts of your program to communicate with each other without having references to each other or even knowing that each other exists. You just have one part of your program listen for or subscribe to a particular notification, and the other part publishes the notification when it is ready.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Thanks for this but I have no idea what you mean by the *pupsub* module. Even google had nothing to offer :slight_smile:
Could you point me in the right direction please ?

Cheers
Tertius

robin@alldunn.com wrote:

···

Tertius Cronje wrote:

Hi All,
I found the GetParent() and GetGrandParent() methods which makes the first SetFocus() and notebook1.SetSelection(page)
possible. Question now is how do I know which windows to pass control back to (re-focus) once I'm done?

WIthout knowing more about the structure of your program all I can say is "however you want." :wink:

Perhaps a different approach that would help you is to use something like the pupsub module in the library, or other Observer pattern modules floating around out there. Then you can allow different parts of your program to communicate with each other without having references to each other or even knowing that each other exists. You just have one part of your program listen for or subscribe to a particular notification, and the other part publishes the notification when it is ready.

I assume he meant 'pubsub', for 'publish/subscribe'. It should be in
your wx/lib directory, in file 'pubsub.py'

···

On Tue, Jun 24, 2003 at 10:30:19PM +0200, Tertius Cronje wrote:

Hi Robin,

Thanks for this but I have no idea what you mean by the *pupsub* module.
Even google had nothing to offer :slight_smile:
Could you point me in the right direction please ?

--
Tim Lesher <tim@lesher.ws>
http://www.lesher.ws

Got it ,
Thanks