[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Passing callback functions
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Passing callback functions

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Cburke   (11 posts)  [Biography] bio
Date Wed 21 Jul 2010 09:17 PM (UTC)  quote  ]
Message
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
[Go to top] top

Posted by Nick Gammon   Australia  (15,726 posts)  [Biography] bio
Date Wed 21 Jul 2010 09:21 PM (UTC)  quote  ]
Message
Template:faq=10424 Please see the forum thread: http://gammon.com.au/forum/?id=10424.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Cburke   (11 posts)  [Biography] bio
Date Wed 21 Jul 2010 10:41 PM (UTC)  quote  ]
Message
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
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


311 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]