Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a new signal in pygtk

I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.

like image 218
clahey Avatar asked Sep 15 '08 20:09

clahey


1 Answers

You can also define signals inside the class definition:

class MyGObjectClass(gobject.GObject):
    __gsignals__ = {
      "some-signal": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, (object, )),
    }

The contents of the tuple are the the same as the three last arguments to gobject.signal_new.

like image 135
Torsten Marek Avatar answered Oct 04 '22 20:10

Torsten Marek