lua-users home
lua-l archive

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

On Sunday 19 August 2007, Merick wrote:
> The gui lib I'm using sends arguments to the callback function, and one
> of them is a pointer. In FreeBasic most (but not all) pointers are just
> an integer, so  I'm thinking that it might be possible to store the
> results from lua_ref() into a hash table using that number as the key,
> then in the callback function I would be able to use that hashtable with
> lua_getref and pcall to run the function from the script

that's exactly what luaL_ref() does: stores any Lua value into a hash table, 
and gives you an integer to retrieve it later.


Attachment: pgpX1ighZ1eaq.pgp
Description: PGP signature