lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I´m almost sure that this was answered before, but I couldn´t find the thread.

How to get and call Lua functions from a method defined in tolua?

Example:



local button = Button:new("Click me!")

function button_onClick(event)
end

button._onClick_ = button_onClick

or


button.onClick( button_onClick )


Then, the class Button must call the function when the button is clicked.


How to get a reference for a Lua function in tolua, and how to call it later?

Thanks

Jose