lua-users home
lua-l archive

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


On Sat, Oct 17, 2009 at 4:47 AM, Jiří Prymus <jiri.prymus@gmail.com> wrote:
> Hi,
>
> I would like to know if there is any chance to convert lua function to
> c function. I program a small opencv wrapper and there is one wrapping
> function where I need pointer to function. And that's a problem
> because I can get only pointer to Lua function and when I convert it
> to C function then it does nothing. I know that lua functions are
> stored in tables and that's probably why it  doesn't work.
>
> In fact my problem is function gtk_signal_connect(...) where slot
> function is my lua function.

If you are manually calling the C function using its pointer, your
design is wrong. Learn how to use upvalues and hook functions.

-- 
-Patrick Donnelly

"Let all men know thee, but no man know thee thoroughly: Men freely
ford that see the shallows."

- Benjamin Franklin