Sounds like hyperscript. Look at this hypothetical PyGtk example:
i = 1
def click(event):
i += 1
g.Window(
g.Frame(title=“Hello”,
g.VBox(
spacing=10,
g.Label(
“i = %d” % i,
expand=True
),
g.Button(“click me”,
click=click,
)
)
)
)
Desktop frameworks could do this for decades instead of Glide XMLs or manual setup, but they didn’t.