import gobject
import gst
import gtk

class MyGObject(gobject.GObject):
    __gsignals__ = {
        'my-signal' : (gobject.SIGNAL_RUN_LAST,
                       gobject.TYPE_NONE,
                       ())
        }

    def __init__(self):
        super(MyGObject, self).__init__()

class MyLabel(gtk.Label):
    __gsignals__ = {
        'my-signal' : (gobject.SIGNAL_RUN_LAST,
                       gobject.TYPE_NONE,
                       ())
        }

    def __init__(self):
        super(MyLabel, self).__init__()

class MyPipeline(gst.Pipeline):
    __gsignals__ = {
        'my-signal' : (gobject.SIGNAL_RUN_LAST,
                       gobject.TYPE_NONE,
                       ())
        }

    def __init__(self):
        super(MyPipeline, self).__init__()

def handler(obj):
    print "Signal emitted on object '%s'" % str(obj)


# This works:
o = MyGObject()

o.connect('my-signal', handler)
o.emit('my-signal')

# This works as well:
l = MyLabel()

l.connect('my-signal', handler)
l.emit('my-signal')

# This doesn't work:
p = MyPipeline()

p.connect('my-signal', handler)
p.emit('my-signal')
