summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2001-12-14 09:06:09 +0000
committerJames Henstridge <jamesh@src.gnome.org>2001-12-14 09:06:09 +0000
commit5e3a4eb1c77121f9db6305aaa3456115255c12db (patch)
tree7328944933f7146b104179d44d1f63fdcbb1834b /examples
parentf2853162d7cd949136f6055afbcf41daa7b03bcf (diff)
downloadpygobject-5e3a4eb1c77121f9db6305aaa3456115255c12db.tar.gz
pygobject-5e3a4eb1c77121f9db6305aaa3456115255c12db.tar.xz
pygobject-5e3a4eb1c77121f9db6305aaa3456115255c12db.zip
use __gsignals__ notation here.
2001-12-14 James Henstridge <james@daa.com.au> * examples/gobject/signal.py: use __gsignals__ notation here. * gobjectmodule.c (create_signal, add_signals): helper routines for handling __gsignals__ attribute of classes. (pyg_type_register): add support for creating signals as part of type registration.
Diffstat (limited to 'examples')
-rw-r--r--examples/signal.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/signal.py b/examples/signal.py
index c52f0ad..3d72e75 100644
--- a/examples/signal.py
+++ b/examples/signal.py
@@ -1,14 +1,15 @@
import gobject
class C(gobject.GObject):
+ __gsignals__ = {
+ 'my_signal': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ (gobject.TYPE_INT,))
+ }
def __init__(self):
self.__gobject_init__() # default constructor using our new GType
def do_my_signal(self, arg):
print "C: class closure for `my_signal' called with argument", arg
-
gobject.type_register(C)
-gobject.signal_new("my_signal", C, gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE, (gobject.TYPE_INT, ))
class D(C):
def do_my_signal(self, arg):