Can
def subscribe(self, listener, topic = ALL_TOPICS):
return an object on which we can call unsubscribe() later?
···
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, January 16, 2008 6:37 PMMichael Moriarity wrote:
> On Jan 15, 2008 3:55 AM, Frank Aune <Frank.Aune@broadpark.no> wrote:
>> On Monday 14 January 2008 23:41:23 Michael Moriarity wrote:
>>> Hello Frank:
>>> I have had success by using:
>>>
>>> wx.CallAfter(Publisher.sendMessage,
>>> topic='SomeTopic',
>>> data=SomeData)
>>
>> But won't this contradict the entire point of pubsub, since you want to
keep
>> your model separated from wx?
>
> The point of pubsub is to avoid having the model be dependent on
knowledge
> about the internals of the GUI. I see it as no problem to import wx and
use
> CallAfter to solve the threading issue.Another possibility is to add another keyword parameter to sendMessage
that indicates whether it should use wx.CallAfter to call the
notification function in the registered subscribers. Or perhaps it
could just be part of the subscription info.