[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to call a Lua object method fom a function in C?
- From: "Michael Cumming" <Mike.C@...>
- Date: Tue, 1 Mar 2005 09:47:33 -0600
Tomas,
The later works great. Thank you.
Mike
> Lobject = { callback = function (self...) .... end}
>
> PassObjectCallbacktoC (Lobject.callback) -- note Lobject:callback
cannot be passed.
You'll have to pass the object and its method:
PassObjectCallbacktoC (Lobject, Lobject.callback)
Or create a closure:
PassObjectCallbacktoC (function () return Lobject:callback() end)
Got it?
Tomas
End of Lua Digest, Vol 98, Issue 2
**********************************