lua-users home
lua-l archive

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


On Wed, Aug 13, 2008 at 10:03 PM, John Dunn <John_Dunn@qscaudio.com> wrote:
> That doesn't appear to work, although accessing the __newindex directly
> does
>
>        -- this works
>        mt = getmetatable(Timer)
>        mt.__newindex("EventHandler", TimerFunc)
>
>        -- this doesn't
>        Timer.EventHandler = TimerFunc

There are three parameters to __newindex, not two - the first is the
table itself, then the key and value.