+
+ mainSizer->Add(sizer, 1, wxEXPAND);
+ mainSizer->Add(new wxStaticLine(panel), 0, wxEXPAND);
+ mainSizer->Add(new wxStaticLine(panel), 0, wxEXPAND);
+
+ m_testBtn = new MyEvtTestButton(panel, "Test Event Handlers Execution Order");
+
+ // After being created, an instance of MyEvtTestButton already has its own
+ // event handlers (see class definition);
+
+ // Add a dynamic handler for this button event in the parent frame
+ Connect(m_testBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
+ wxCommandEventHandler(MyFrame::OnClickDynamicHandlerFrame));
+
+ // Bind a method of this frame (notice "this" argument!) to the button
+ // itself
+ m_testBtn->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
+ wxCommandEventHandler(MyFrame::OnClickDynamicHandlerButton),
+ NULL,
+ this);
+
+ mainSizer->Add(m_testBtn);
+ panel->SetSizer(mainSizer);