(self, name='world')
| 23 | |
| 24 | class MyApp(App): |
| 25 | def main(self, name='world'): |
| 26 | # margin 0px auto allows to center the app to the screen |
| 27 | wid = gui.VBox(width=300, height=200, margin='0px auto') |
| 28 | |
| 29 | bt = gui.Button('Close App', width=200, height=30) |
| 30 | bt.style['margin'] = 'auto 50px' |
| 31 | bt.style['background-color'] = 'red' |
| 32 | |
| 33 | bt.onclick.do(self.on_button_pressed) |
| 34 | |
| 35 | wid.append(bt) |
| 36 | return wid |
| 37 | |
| 38 | # listener function |
| 39 | def on_button_pressed(self, _): |