lua-users home
lua-l archive

Passing functions addresses to tolua classes

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


Hi!
Is there some way of do this?
Later, I will call the function inside the method "doDomething". How 
to store the function to call it later? I know how to do using 
lua_ref, but how to do this with tolua "classes"?
function someFunc()
...
end
function someOtherFunc()
...
end
theClass = MyClass:new()
theClass:SetFunc(someFunc)
theClass:doDomething()
theClass:SetFunc(someOtherFunc)
theClass:doDomething()

AltStyle によって変換されたページ (->オリジナル) /