Draw a button and connect it to a callback function.
(self, view, nsParent=None, **kwargs)
| 31 | self.callback = callback |
| 32 | |
| 33 | def build(self, view, nsParent=None, **kwargs): |
| 34 | """Draw a button and connect it to a callback function. |
| 35 | """ |
| 36 | assert nsParent is not None |
| 37 | button = self.context.button(title=self.title, x=self.x, y=self.y, |
| 38 | w=self.w, h=self.h, style=self.style, callback=self.callback) |
| 39 | print('dsdadas', button, self.callback) |
| 40 | setattr(nsParent, self.name or 'untitledButton', button) |
| 41 | |
| 42 | if __name__ == '__main__': |
| 43 | import doctest |