Can i link any functions with "main loop"?
Can i link any functions with "main loop"?
Hi, i need to link any functions with "main loop", but i didn't do that before, so i don't know how to do that. I am using template of ccode by wxSmith. Thank you for every answer.
Re: Can i link any functions with "main loop"?
Hard to understand what you mean. May be description of what you are going to achieve (what is your task? what do you attempt to resolve?) could help.to link any functions with "main loop"
wx as most GUI is event-driven. Look to API of wxApp and its base classes wxAppConsole and wxEvtHandler.
There are
wxAppConsole::FilterEvent() - look at every event in the "Loop"
wxEvtHandler::QueueEvent or wxEvtHandler::AddPendingEvent to post events to the loop
Use wxTimer to shedule delayed/periodic task
Check wxIdleEvent for background low-priority tasks.
and so on
If you need to do cpu-intensive work all the time or during continuous periods you have to move it to parallel thread ("worker") and there you may implement all the loops and whistles you may want, but be aware AFAIK you can not access wx GUI from there and need to set up some way of thread communication.