Specifying callback function from Lua #153
Unanswered
MichaelSenko
asked this question in
Q&A
Replies: 1 comment
-
|
Hello Mike, it is easy, but not real lua. Only the signature must fit. So this is also possible: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Lua program that uses LuaInterface to create a Winforms GUI. I'm looking to move the application to 64-bit, and started running some tests with NeoLua. I'm stuck at how to create a button and specify a Lua callback for the Click event. In LuaInterface I do this:
local Button = luanet.import_type("System.Windows.Forms.Button")
local function callback()
print ("click detected")
end
local okButton = Button()
okButton.Click:Add(callback)
In NeoLua, there's no problem creating the button and adding it to a form, but I haven't figured out how to specify the callback.
Thanks
Mike
Beta Was this translation helpful? Give feedback.
All reactions