import gobject
gobject.type_register(MyWidgetClass)
gobject.signal_new('my-signal-name', MyWidgetClass,
gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [])

In the MyWidgetClass, use:
self.emit('my-signal-name')
to emit that signal. And if you defined arguments for that
signal(using gobject.signal_new) give that arguments to emit function.
for example:

gobject.signal_new('my-signal-name', MyWidgetClass,
gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, [int, str])

self.emit('my-signal-name', 5, 'test') ## two arguments [int, str]


On 9/27/09, samwyse <[email protected]> wrote:
> I writing a pygtk app that will use a plug in architecture.  I'm thinking
> about reusing the existing signal mechanisms to trigger the plug-ins at the
> appropriate times.  The tutorials don't go into how to define your own
> signals.  Can anyone enlighten me?  Thanks.
>
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to