Getting a function reference to a method in a class you are writing
Posted: 25 Sep 2020, 19:32
How do I get a function reference to a method in a class I am writing?
For example, I need a reference to "mycallback" to send to "OnEvent" in "__New," below. How do I get it?
Thanks for any help in advance.
For example, I need a reference to "mycallback" to send to "OnEvent" in "__New," below. How do I get it?
Code: Select all
global MyGuiObj := MyGUIClass.new()
class MyGUIClass
{
__new() {
this.MyGui := Gui.New()
this.MyEdit := this.MyGui.Add("Edit")
this.MyEdit.OnEvent("Change", this.mycallback)
}
mycallback(GuiCtrlObj, Info){
}
}