KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/share/doc/pygtk2-2.10.1/examples/gobject/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/pygtk2-2.10.1/examples/gobject/signal.py
import pygtk; pygtk.require("2.0")
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

class D(C):
    def do_my_signal(self, arg):
        print "D: class closure for `my_signal' called.  Chaining up to C"
        C.do_my_signal(self, arg)

def my_signal_handler(object, arg, *extra):
    print "handler for `my_signal' called with argument", arg, \
          "and extra args", extra

inst = C()
inst2 = D()

inst.connect("my_signal", my_signal_handler, 1, 2, 3)
inst.emit("my_signal", 42)
inst2.emit("my_signal", 42)

Anon7 - 2021