[wxPython-users] Re: "Pushing" Data to Modules
Rich Shepard
rshepard at appl-ecosys.com
Sun Dec 3 16:58:35 PST 2006
On Sun, 3 Dec 2006, Robin Dunn wrote:
> Basically, it's
> Publisher().subscribe(callable, topic)
> and
> Publisher().sendMessage(topic, data=None)
Well, darn! That's what I thought I have.
In the OpenDB() function I have
Publisher().sendMessage(self.appData.projOpen, data=None)
and in the class modPolicy()'s __init__() method I have
Publisher().subscribe(self.setWidgets, self.appData.projOpen)
with setWidgets() a function that places values in the treeCtrl.
But the error is still that the subscribe method has no arguments:
File "/data1/eikos/policyPage.py", line 124, in __init__
Publisher().subscribe(self.setWidgets, self.appData.projOpen)
File
"/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/lib/pubsub.py",
line 638, in subscribe
self.validate(listener)
File
"/usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/lib/pubsub.py",
line 670, in validate
raise TypeError, 'Listener '+istener+' lacking arguments!'
TypeError: Listener <bound method modPolicy.setWidgets of
<policyPage.modPolicy; proxy of C++ wxPanel instance at
_00534408_p_wxPanel>> lacking arguments!
Should the Publisher().subscribe() be located somewhere other than in the
init method?
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
More information about the wxpython-users
mailing list