lua-users home
lua-l archive

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

> I always get "left click widget 2". This is, because the widgets share the
> same method table, so the last definition simply overwrites all previous
> ones. How do I change my C code, so my users can have the above code
> working?

I do this with environment tables.  For each instance you can set a
new environment.  In your __index method, you can check the
environment before checking the metatable to get per-instance methods.