I am not using MaxGUI but would like to understand Events and Hooks but find the documentation VERY poor.
As a test I would like to create a timer which, when ticked, issues a MY_EVENT. However, I have no idea how to use CreateEvent. The parms (id,source:Object=Null,data=0,mods=0,x=0,y=0,extra:Object=Null ) are not exactly self-explanatory.
Leaving the defaults and specifying CreateEvent(MY_EVENT) fails with 'ID MY_EVENT not found'.
I can get past this by creating a function called MY_EVENT but I'm now off into the unknown.
Anybody able to help?
<edit> Blimey, got the first bit to work...
but from trial+error.
As a test I would like to create a timer which, when ticked, issues a MY_EVENT. However, I have no idea how to use CreateEvent. The parms (id,source:Object=Null,data=0,mods=0,x=0,y=0,extra:Object=Null ) are not exactly self-explanatory.
Leaving the defaults and specifying CreateEvent(MY_EVENT) fails with 'ID MY_EVENT not found'.
I can get past this by creating a function called MY_EVENT but I'm now off into the unknown.
Anybody able to help?
<edit> Blimey, got the first bit to work...
SuperStrict Graphics 800,600 Local MY_EVENT:TEvent=CreateEvent(69) Local myTimer:TTImer = CreateTimer(3,MY_EVENT) While EventID() <> EVENT_KEYDOWN WaitEvent If EventID() = 69 Print "Timer has ticked " + TimerTicks(myTimer) + " times" EndIf EndWhile
but from trial+error.