
|
<<
Index
>>
|
FutureBasic
|
HandleEvents
|
|
statement
|
|
Syntax
HandleEvents
Overview
With the removal of Carbon Events, FB, via HandleEvents, now calls the Objective-C/Cocoa runtime for starting the app and monitoring events.
The Objective-C runtime, upon receiving the request from HandleEvents, puts the app in a run loop so it can receive events.
Once the Cocoa runtime/event monitoring is initiated, HandleEvents ends (but the runloop it initiated continues on!);
the runloop (i.e. Cocoa runtime) now traps all your app's events invisibly and sends them to your app for consideration.
Where to put it and how often to execute it
- HandleEvents should execute only ONCE at app startup - good locations for it are:
- In a project put it in the '.main' source file (make a new project file in FB to see an example)
- In a single source file put it last in the file
- That's it, you're done! Intercepting the events your app needs is a different coding effort and not specific to coding the HandleEvents statement.
- For event interception look at the "See also"links below and Appendix N: Events.
See also
on appevent; on dialog; on menu; Appendix N: Events