I have a doubt about the way wxWidgets handles the handling of events.
Scenario: I'm inside a secondary thread, and I want to send an event in order for the main one to process it and "do something".
I do something like :
Code: Select all
m_parent->GetEventHandler()->ProcessEvent(eventToBeProcessed);
// Process an event right now: this can only be called from the main
// thread, use QueueEvent() for scheduling the events for
// processing from other threads.
Because I want the event to be processed immediately.
I know that I could have used the following line too
Code: Select all
m_parent->GetEventHandler()->AddPendingEvent(eventToBeProcessed);
but I see from the call stack of visual studio that in the first case (ProcessEvent), a worker thread handles the event.
In the second case, the main thread does it. Why this behaviour?
thank you very much in advance!