
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.52 KB | hits: 16 | expires: Never
Difference between connect() and connect_object() in pygtk
>>> label = gtk.Label()
>>> button = gtk.Button()
>>> def callback(obj):
... print obj
>>> button.connect('clicked', callback) # button will be passed by default
>>> button.emit('clicked')
<gtk.Button object at 0x27cd870 (GtkButton at 0x22c6190)>
>>> button.disconnect_by_func(callback)
>>> button.connect_object('clicked', callback, label) # label will be passed instead of button
>>> button.emit('clicked')
<gtk.Label object at 0x27cd9b0 (GtkLabel at 0x22b64f0)>