Originally Posted by Choonstertwo
Shouldn't that __index metamethod be checking the regular tooltip __index table at some point? That's where all the tooltip methods are stored and your metamethod seems to bypass it completely.
Alternatively, use a separate table as a self-generating cache instead of overloading the tooltip itself.
|
It does use tooltip to store, it's both a table and a widget and if you try tooltip[1234] and it doesn't exist, then it calls the function at __index to do a lookup and store the result string at that position, so next time you call tooltip[1234] it returns the string instead of doing a lookup. I refer to the tooltip object using "self" in the function, it's the same object.