I have a listener thread send message to a frame in wxpython,it work.but now I want to make multiframe,can I use this listener thread send diffrent message to two frame?If it can do this?How should I do?
Thanks!
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.
I like to use pubsub combined with threads for this sort of thing. There’s an example in my blog article here: http://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/
Basically you set up a couple of listeners (one per frame for your example) and then publish messages to those listeners from the threads using one of wx’s thread-safe methods.