connect(receiver=None,
signal=<Gnumed.pycommon.gmDispatcher._Any object>,
sender=<Gnumed.pycommon.gmDispatcher._Any object>,
weak=0)
| source code
|
Connect receiver to sender for signal.
If sender is Any, receiver will receive signal from any sender.
If signal is Any, receiver will receive any signal from sender.
If sender is None, receiver will receive signal from anonymous.
If signal is Any and sender is None, receiver will receive any signal from anonymous.
If signal is Any and sender is Any, receiver will receive any signal from any sender.
If weak is true, weak references will be used.
ADDITIONAL gnumed specific documentation:
this dispatcher is not designed with a gui single threaded event loop in mind.
when connecting to a receiver that may eventually make
calls to gui objects such as wxWindows objects, it is
highly recommended that any such calls be wrapped in
wxCallAfter() e.g.
def receiveSignal(self, **args):
self._callsThatDoNotTriggerGuiUpdates()
self.data = processArgs(args)
wxCallAfter( self._callsThatTriggerGuiUpdates() )
since it is likely data change occurs before the signalling, it would probably look more simply like:
def receiveSignal(self, **args):
wxCallAfter(self._updateUI() )
def _updateUI(self):
# your code that reads data
Especially if the widget can get a reference to updated data through
a global reference, such as via gmCurrentPatient.
|