(I wasn't sure if I should post this here or in the 'Absolute Beginners' Section', but it's a development question, so I'll post it here.)
I found several tutorials, like The Python GTK+ 3 Tutorial, which is pretty nice for a novice.
I am struggling to find PyGObject documentation, I am not clear on the callback functions signature. In the above tutorial the connect() call looks like this
Code:
self.button.connect("clicked", self.on_button_clicked)
and the callback looks like this:
Code:
def on_button_clicked(self, widget):
print("Hello World")
the widget parameter being the button which connect() was called (am I right?). Elsewhere I have seen callbacks like this:
Code:
def on_button_clicked(self, widget, data=None):
print("Hello World")
On gnome.org I fount this:
' The required signature of a callback function is determined by the context in which is used (e.g. the signal to which it is connected).'
I would like to know how could I determine the appropriate callback signature for any given signal. Thanks in advance.
Bookmarks