문제

I've searched among the documentation of Python, and PyGtk but i couldn't find the right syntax for a generic signal handler written by the programmer; i've just found the documentation for the classic API provided by the library(PyGtk).

This is the syntax for my function for every method i've in my modules:

def Continua_Button_clicked(self, widget, event, *args):

But is it correct?

How can i be sure i'll got the widget reference, the event that fired up the signal handler and the arguments of the event?

I'm a bit confused of what and how many arguments i'll got from each event, and how many arguments my signal handler will get.

도움이 되었습니까?

해결책

It depends on the signal what exactly is passed in; you'd consult the gkt.Widget signal documentation.

For example, the button-press-event signal expects:

def callback(widget, event, *user_params):

but child-notify will use:

def callback(widget, child_property, *user_params)

etc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top