Passing callback functions

Posted by Cburke on Wed 21 Jul 2010 09:17 PM — 3 posts, 15,228 views.

#0
Is there a way I can pass a callback function directly to WindowAddHotspot() and similar functions that use callbacks?

By this I mean I'd like to pass the actual function or specify a function within a table rather that a function which is directly defined in the global scope.

I ran across this while I was trying to repackage some things into more of an object oriented layout. I'm wanting to specify functions such as "TextWindow:MouseOver" as the callback, but since it's really looking for a string and not a function it doesn't know how to interpret this.

Just looking for some thoughts on this.

Thanks,

-C
Australia Forum Administrator #1
Template:post=10424
Please see the forum thread: http://gammon.com.au/forum/?id=10424.
#2
Thanks Nick - makes sense. I figured it was a language compatibility thing. This also sheds some light on the "function generating functions" you have in the movewindow.lua code.

-C