Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Lua
➜ Passing callback functions
Passing callback functions
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Cburke
(11 posts) Bio
|
Date
| Wed 21 Jul 2010 09:17 PM (UTC) |
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 | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 21 Jul 2010 09:21 PM (UTC) |
Message
| |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Cburke
(11 posts) Bio
|
Date
| Reply #2 on Wed 21 Jul 2010 10:41 PM (UTC) |
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 | 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.
11,872 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top