The best way to send and catch events

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
HeReSY
Earned some good credits
Earned some good credits
Posts: 120
Joined: Fri Sep 17, 2004 8:58 pm
Location: Germany

The best way to send and catch events

Post by HeReSY » Sat Dec 15, 2007 11:55 pm

Hi,

i have an application with this structure.

wxFrame
|
|-wxNotebook1
| |
| |-wxTreeCtrl
|
|-wxNotebook2
|
|-wxListCtrl

Now i want to catch the event when the selection in the wxTreeCtrl changed. After catching the event something should happen in the wxListCtrl.
Where is the best place to catch the event?
Is it better to catch it in the wxFrame and then call a memberfunction from wxListCtrl through wxNotebook2 or catch the event directly in the wxListCtrl?
Or is there better solution for that?

HeReSY

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Wed Dec 26, 2007 5:43 pm

I think wxFrame is a good place to catch the event, and then transfer the control directly to wxListCtrl.
This looks something like a mediator design pattern.

Post Reply