lua-users home
lua-l archive

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


Hallo,

On 5/18/06, Daniel Collins <daniel.collins@internode.on.net> wrote:
In the C methods operating on the userdata, I can use luaL_checkudata to
verify that the userdata is the correct type. Is there any analogous way
to do this on the lua side? Just doing 'type(object) == "userdata"' is
not sufficient, since that doesnt distinguish a Button from any other
userdata type.


    You can do what luaL_checkudata does: check if the object's
metatable is equal to the metatable of the "type".

--
-alex
http://www.ventonegro.org/