It does seem obvious what the clicked
signal should do, but you're misunderstanding the syntax for connecting a signal handler. Normally that would raise a more intuitive error, but in this case there's also a clicked()
method on Gtk.Button
that you are inadvertently calling. (That method is part of very old but not-yet-deprecated API, and fires a fake clicked
signal.)
Do this:
button.connect('clicked', self.on_button_clicked)
(remember not to put ()
after self.on_button_clicked
, as eduffy pointed out, because you're not calling the method, but passing it as a parameter to another method.)