wxWidgets Multi threading

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.
Post Reply
nona
Knows some wx things
Knows some wx things
Posts: 32
Joined: Fri Apr 20, 2018 2:49 pm

wxWidgets Multi threading

Post by nona »

Hi,
I am trying to write a GUI app the main thread to add two numbers. and I want to add another thread to display a word on the same screen at the same time. Is that possible? I tried to use the documentation example but could not make it run.
http://docs.wxwidgets.org/3.0.4/classwx_thread.html
Manolo
Can't get richer than this
Can't get richer than this
Posts: 827
Joined: Mon Apr 30, 2012 11:07 pm

Re: wxWidgets Multi threading

Post by Manolo »

Using the GUI in a secondary thread is can of worms. Don't do it. Instead, you can send messages from a thread to the main thread so as to display whatever you want.

The sample "thread" (at yourwxdir/samples/thread) is a good guidance in writting multithread apps in wxWidgets.
Post Reply