Connect the callback function *func* to button click events. Returns a connection id, which can be used to disconnect the callback.
(self, func)
| 289 | self.canvas.draw() |
| 290 | |
| 291 | def on_clicked(self, func): |
| 292 | """ |
| 293 | Connect the callback function *func* to button click events. |
| 294 | |
| 295 | Returns a connection id, which can be used to disconnect the callback. |
| 296 | """ |
| 297 | return self._observers.connect('clicked', lambda event: func(event)) |
| 298 | |
| 299 | def disconnect(self, cid): |
| 300 | """Remove the callback function with connection id *cid*.""" |