Object Functions
Posted: Sun Jan 01, 2012 6:23 pm
Hi,
Having a little issue here, thought I'd create some object functions rather than my usual approach of prefix naming. Just having a little problem with the InstallEventHandler() command. I have found the solution, but I didn't think that this was necessary.
If I specify InstallEventHandler({CloseWindow = p_objman:CloseWindow}) - program doesn't flow into the object function, I have to call p_objman_CloseWindow() instead which then points to the object function.
I have also generally noticed that I cannot pass parameters to the function through InstallEventHandler().
Having a little issue here, thought I'd create some object functions rather than my usual approach of prefix naming. Just having a little problem with the InstallEventHandler() command. I have found the solution, but I didn't think that this was necessary.
Code: Select all
p_objMan = {}
Function p_objman:CloseWindow()
....
EndFunction
InstallEventHandler({CloseWindow = p_objman_CloseWindow})
Function p_objman_CloseWindow() p_objman:CloseWindow(False) EndFunction
I have also generally noticed that I cannot pass parameters to the function through InstallEventHandler().