views:

543

answers:

0

I'm writing a cross-platform application. Is there a way in wxWidgets to define my own event loop? How to do that? I want it look like an ordinary windows PeekMessage DispachMessage loop:

for(;;)
{
    while(PeekMessage(...)) // dispatching all pending messages
    {
     // traslating, dispatching messages
     // also do something with them.
    }
    if (there_was_a_quit_message) break;
    // do something when no messages are pending
    Sleep(10); // give some time to other processes / threads.
}

I found neither a peekmessage equvivalent nor a function which is called on every loop.

The main reason to write my messageloop is I want to get rid of my timer events and write my own timing. The timer events are sometimes inaccurate and late. And I don't know why.