How can I change the current selection in a wxListbook from another thread?
When I pass the listbook’s pointer to the thread and try to change the selection, the app crashes. What is a safe way of doing this? Is there some message I can send to it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually you should avoid accessing wxWidget objects outside the main thread. wxWidgets isn’t thread safe. What you can do is sending an event to the main thread. So you do your work in your own thread but do the updating of
wxListbookinside the main thread.