[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Augmenting objects on per instance basis
- From: "Wesley Smith" <wesley.hoke@...>
- Date: Mon, 7 Jul 2008 22:15:33 -0700
> 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.
wes