WxWidgets 2.9 custom events

I seem to have followed this example (found in the section "Defining Your Own Event Class") , and my code compiles and runs without errors, but I will not catch anyone.

The code:

class MyCustomEvent : public wxEvent
{
//... stuff here
};
wxDEFINE_EVENT(MY_CUSTOM_EVENT_1,MyCustomEvent);

and later I bind the event:

Bind(MY_CUSTOM_EVENT_1, &MyApp::OnProcessCustom, this);

and then I throw an event of this type:

MyCustomEvent* eventCustom = new MyCustomEvent(MY_CUSTOM_EVENT_1);
eventCustom->SetEventObject(this);
this->QueueEvent(eventCustom); //this is MyApp

Unfortunately, after an event is selected, it never gets into OnProcessCustom.

Any ideas?

Note: It seems, but not the same, as this question .

+1
source share
1 answer

, , , , . , this Bind(), MyApp.

, , ( wxCommandEvent , ).

+1

Source: https://habr.com/ru/post/1742689/


All Articles