If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
2 posts • Page 1 of 1
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.
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.
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.