FutureBasic Logo

<<    Index    >> FutureBasic

on appevent   statement

on appevent fn userFunction

This statement designates a particular function as an application event handling routine. An application event handling function is called in response to a variety of application notifications.

If you use on appevent fn userFunction, then userFunction must refer to a function which was defined or prototyped at an earlier location in the source code. Your application event handling function should not return a result.

This example assumes an application event handling function has been designated with the name "DoAppEvent" via a "on appevent fn DoAppEvent".

void local fn DoAppEvent( ev as long, obj as CFTypeRef )

select ( ev )
case _appWillFinishLaunching
... do something
case _appShouldTerminateAfterLastWindowClosed
end select
end fn

App events

App event functions
AppEventSetBool( BOOL value )
AppEventSetLong( long value )
AppEventString = CFStringRef
AppEventArray = CFArrayRef
AppEventDictionary = CFDictionaryRef
AppEventURL = CFURLRef
AppEventSetMenu( CocoaMenuRef m )
Apple documentation