Hi Werner,
Werner F. Bruhin пишет:
Hi Basil,
Basil Shubin wrote:
Merry Christmas!
I'll trying to use pubsub in my MVP redesigned application, but fail in some place. Please, examine attached source code. In a module 'data/wordinteractor.py' I have add Publisher.sendMessage call and want to recive it in a 'data/meaningpresenter.py', but that's doesn't happened. My the task is: on each item selection in 'Word' list should happen some events in a 'Meaning' list. I decide to 'wx.lib.pubsub' for this, but I am unable to get it wotking.
You are not instantiating the Presenter.
I put the attached module into your test folder and then changed the imports from
from wx.lib.pubsub import Publisher
to
import mypublisher as mypub
and this
Publisher.subscribe
to
mypub.publisher.subscribe
Thanks for reply. You test code works excellent. But problem is that I want subscribe to message inside MeaningInteractor class and process catched message here, but with a code I wrote (attachment) it's not working Yes I can successfuly call MyPrint from data/publisher.py in MeaningInteractor, but the same function placed inside MeaningPublisher won't process
I'm totally confused here. Please, needs your help.
Thanks for any help.
testapp.zip (7.31 KB)