How can I reach dialog elements from python macro

Hi All. I have simple login form and macro, which should run on OK btn


But I don’t know how can I get data from my fields withing macro? Think it should be done the same way as another languages via sender object. Please, do you have an example)

Try:

def cmd_ok(event):
    button = event.Source
    dialog = button.Context
    text = dialog.getControl('txt_login')

    login = text.Model.Text

    return