Hi, I am not a very experienced programmer in c++ and wxWidgets.
I would like to have an example on how wxWidgets could display incomming serial data from a non wxWidgets thread.
I need to have a C++ console application that run several different threads not depending on wxWidgets.
I need to be able to display data to the wxwidgets app in a textbox for this example.
I also need to receive command from wxwidgets to act in my core program (the other threads).
The point of all this is to be able to use any GUI with the core program.
I understand how to create a custom event (I think lol).
But I struggle to queue the event or to use the callafter() function.
Can someone show me a quick set up to do so please?
Dont hesitate if I did not put enough details.
Olivier
How display data from an external thread
Re: How display data from an external thread
I think the wxThread documentation properly demonstrates how to use events (the principle remains the same even if you don't use wxThread):
https://docs.wxwidgets.org/trunk/classwx_thread.html
Here's a sample using CallAfter():
In both cases you need an object that derives from wxEvtHandler (usually a wxFrame or wxPanel). Either to send the event to it, or to invoke its CallAfter method.
https://docs.wxwidgets.org/trunk/classwx_thread.html
Here's a sample using CallAfter():
In both cases you need an object that derives from wxEvtHandler (usually a wxFrame or wxPanel). Either to send the event to it, or to invoke its CallAfter method.
Use the source, Luke!