I am trying to use a custom event in my WxWidgets C ++ application, as described here .
In the constructor of my wxApp:
Connect(wxID_ANY, wxCommandEventHandler(APP::OnMyEvent));
Then the function that should catch the event:
void APP::OnMyEvent(wxCommandEvent& event)
{
exit(0);
}
Finally, to check this out:
wxCommandEvent MyEvent(wxEVT_COMMAND_BUTTON_CLICKED);
wxPostEvent(this, MyEvent);
I am launching a thing ... but it seems that the event is not published or not found.
Does anyone understand this behavior?
Klaus source
share