Is it possible to specify an anonymous function to be called from onEvent in Autohotkey 2?
04:57 02 Jul 2019

I am wondering if I can specify an anonymous function to be called with onEvent in Autohotkey V2.

The following, not working, script tries to outline what I try to achieve:

g := guiCreate()

txt := g.add('text', 'w200 r1')
txt.text := 'Hello!'

g.onEvent('close', (*) => function() {
  msgBox('Going to exit application')
  exitApp()
})

g.show()
autohotkey