[wxPython-users] wxPython + signals
Jürgen Kareta
python at kareta.de
Wed Oct 25 04:51:41 PDT 2006
Jorgen Bodde schrieb:
> Hi all,
>
> I am searching for something like SigSlot (the C++'s counterpart). The
> main idea is that I want to make a data model that pushes messages /
> signals to my wxPython application. This way the GUI will be a 'dumb'
> listener, and when e.g. a signal arrives that e.g. a project item is
> added to the DB, I can act upon it to list it in my combobox for
> example (don't mind the syntax I am real new to python):
>
> Something like;
>
> class MyComboBox(wx.ComboBox)
>
> def AddNewProjectItem(prjid, name):
> # append to combobox
> _projects.Append(name, prjid)
>
> Where I can subscribe my AddNewProjectItem method to a signal / slot
> library, which gets triggered once the user has added the project:
>
> Adding to a trigger:
>
> _addProjectSignal.connect(AddNewProjectItem)
>
> Firing it:
>
> def CreateNewProject:
> dlg = new MyPatientDialog()
> if dlg.ShowModal == wx.OK:
> _addProjectSignal.submit(dlg.prjname, dlg.prjid)
>
> The idea is that if more methods are connected to the one signal,
> various parts of the GUI are updated this way.
>
> Is there something like this in (wx)Python ? I saw that PyQT has it's
> signslot implementation but it should be more generic I guess..
>
> Regards,
> - Jorgen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
>
Hi Jorgen,
look up pydispatcher:
*pydispatcher*.sourceforge.net
Regards,
Jürgen
*
*
More information about the wxpython-users
mailing list