Hi everyone
when I study pygtk, for the code
self.button1.connect("clicked", self.callback, "button 1")
when I check the PyGTK 2.0 Reference Manual,I find this:
The "clicked" gtk.Button Signal
def callback(*button*, *user_param1*, *...*)
*button* :
the button that received the signal
*user_param1* :
the first user parameter (if any) specified with the connect() method
*...* :
additional user parameters (if any)
there are only two Parameters
so I change the default callback function
def callback(self,widget, data=None):
print "Hello again - %s was pressed" % data
to
def callback(widget, data=None):
print "Hello again - %s was pressed" % data
but I get this error
TypeError: callback() takes at most 2 arguments (3 given)
can any one help me ?
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/