class MainWindow(Window):
    my_button = Button('Click Me')
my_paragraph = Text('This is the text you wish to place')
my_alert = AlertBox('What what what!!!')

@my_button.clicked
def my_button_clicked(self, button, event):
    self.my_paragraph.text.append(
        'And now you clicked on it, the button that is.')

@my_paragraph.text.changed
def my_paragraph_text_changed(self, text, event):
    self.button.text = 'No more clicks!'

@my_button.text.changed
def my_button_text_changed(self, text, event):
    self.my_alert.show()


class Style:
    my_button = {'background-color': '#ccc', 'font-size': '14px'}
my_paragraph = {'background-color': '#fff', 'color': '#000', 'font-size':
    '14px', 'border': '1px solid black', 'border-radius': '3px'}
MainWindow.Style = Style


class MainLayout(Layout):

    def __init__(self, style):
        style.window.pack(HBox().pack(style.my_paragraph, style.my_button))
MainWindow.Layout = MainLayout
if __name__ == '__main__':
    run(App(main=MainWindow))
Как бы вы разработали очень «питоновский» UI-фреймворк?