[pygtk] about "clicked" signal

engine spot enginespot at gmail.com
Wed Dec 9 21:03:45 WST 2009


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 ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20091209/67c94cfb/attachment.htm 


More information about the pygtk mailing list