ChildFrame events..
Vadim Zeitlin
vadim at wxwindows.org
Thu Oct 19 08:45:31 PDT 2006
On Wed, 18 Oct 2006 14:40:38 +0100 Rory Walsh <rorywalsh at ear.ie> wrote:
RW> I am trying to get a childframe to call my main frames OnClose event
RW> handler when I close it but I can't seem to get it to work. Here is the
RW> code, perhaps someone can spot what must be a silly mistake? loopStation
RW> in the code below is a vector of MDIChildFrame's. I would like to
RW> dynamically attach event to the childframes, is this possible? Cheers,
...
RW> loopStation[loopCnt]->Connect(ID_MENU_QUIT,
RW> wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&wxLooperFrame::OnQuit);;
You *must* use the eventSink parameter of Connect() when you connect an
event to a method of another class. Just think about it, how is wxWidgets
supposed to know which wxLooperFrame to send the event to if you didn't
give it a pointer to it?
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list