lua-users home
lua-l archive

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


Hi!

Consider the following cleaned class, in sample.pkg:



class Sample{
  Sample();
  ~Sample();

  void SetCallback( t_function f );// what type is correct to get a 
Lua function pointer?
}

In Lua, I would like to do this:

function test()
...
end


sample = Sample:new()

sample:SetCallback(test)

That's the point! In C++, what type is "t_function"?
And how to store the address of the parameter (a function) in C++, to 
call it later?

I know how to do all this in pure Lua, but using tolua (a great tool)
I don't know how!!!