Repainting children from menu option

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.
dark.tempest360
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jun 15, 2018 4:24 pm

Repainting children from menu option

Postby dark.tempest360 » Tue Jun 19, 2018 1:55 pm

Is there a way to refresh all child widgets of a wxFrame (or wxPanel) from clicking a menu option? Refresh() and Update() does not work. I've also read that Refresh() doesn't work unless if its called from the main thread and that there is no way to queue a paint event as well that would repaint the ui.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2517
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Repainting children from menu option

Postby ONEEYEMAN » Tue Jun 19, 2018 3:37 pm

Hi,
All GUI calls has to be done in the main thread. No exceptions.
What you can do is to send a message from the secondary thread and in the main thread catch it and call the Refresh()/Update().

Thank you.


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 16 guests