Skip to content
  • Simon Feltman's avatar
    [API add] Add Signal class for adding and connecting custom signals. · a7c52421
    Simon Feltman authored
    The Signal class provides easy creation of signals and removes the
    need for __gsignals__ in client code. The Signal class can also be
    used as a decorator for wrapping up the custom closure. As well as
    providing a "BoundSignal" when accessed on an instance for making
    connections without specifying a signal name string.
    Python3 annotations can also be used to supply closure argument and
    return types when Signal is used as a decorator. For example:
    
    class Eggs(GObject.GObject):
        @GObject.Signal
        def spam(self, count:int):
            pass
    
    https://bugzilla.gnome.org/show_bug.cgi?id=434924
    a7c52421