[pygtk] gobject.connect
Pierre Barthelemy
barthpi at gmail.com
Mon Apr 23 18:44:09 WST 2012
Hi everyone,
I am new to this mailing list. I am working on a program to perform data
analysis in python. This program is based on a library already developped,
that uses pygtk to create data-handling objects.
This data object inherits from gobject.GObject, and defines a few signals
"new-data-point".
I would like to connect this signal to a few functions, specifying the
arguments of these functions. I have read the PyGTK webpage (
http://www.pygtk.org/docs/pygobject/class-gobject.html#method-gobject--connect),
which specifies that i just have to concatenate in the "connect" call the
arguments: "object.connect("signal_name",handler,arg1,arg2,arg3)
I therefore have written:
data.connect("new-data-point", handler,'text')
and defined the handler function as suggested: def
handler(object,arg1,arg2,arg3)
def handler(data,argument):
print data
print argument
However, when i do execute the "connect" function, i get the error message:
"connect takes exactly 3 arguments (4 given).
Could you tell me how i could then specify arguments for the functions to
be called when the signal is given ?
Bests,
Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20120423/fc339f14/attachment.html>
More information about the pygtk
mailing list