如何在 KivyMD 中更改 widget 参数的值

How to change the value of the widget argument in KivyMD

如何通过单击按钮更改小部件参数?例如有一个按钮

MDRaisedButton:
        id: but
        pos: (150,150)
        text: 'Старый текст'
        on_press: app.func()

如何通过单击同一按钮将文本参数替换为 'New text' 等?我需要在 func 函数中写什么才能让它工作?

MDRaisedButton:
    id: but
    pos: (150,150)
    text: 'Старый текст'
    on_press: app.func(self)


def func(self, instance_button):
    instance_button.text = "New text"