Important: The information in this document is obsolete and should not be used for new development.
GetSpecificHighLevelEvent
You can use theGetSpecificHighLevelEvent
function to select and optionally retrieve a specific high-level event from your application's high-level event queue.
FUNCTION GetSpecificHighLevelEvent (aFilter: GetSpecificFilterProcPtr; yourDataPtr: UNIV Ptr; VAR err: OSErr): Boolean;
aFilter
- Specifies the filter function that
GetSpecificHighLevelEvent
should use to search for a specific event.GetSpecificHighLevelEvent
calls your filter function once for each event in your application's high-level event queue until your filter function returnsTRUE
or the end of the queue is reached.yourDataPtr
- Specifies the criteria your filter function should use to select a specific event. For example, in the
yourDataPtr
parameter you can specify a reference constant to search for a particular event, a pointer to a target ID record to search for a specific sender of an event, or an event class to search for a specific class of event.err
GetSpecificHighLevelEvent
returns in this parameter a value indicating if any errors occurred. Theerr
parameter contains thenoErr
constant if no errors occurred ornoOutstandingHLE
if no high-level events are pending in your application's high-level event queue.DESCRIPTION
You can use theGetSpecificHighLevelEvent
function to search for a specific high-level event in your application's high-level event queue. You provide a pointer to a filter function as one of the parameters toGetSpecificHighLevelEvent
. TheGetSpecificHighLevelEvent
function calls your filter function once for every event in your application's high-level event queue, until your filter function returnsTRUE
or the end of the queue is reached.The
GetSpecificHighLevelEvent
function passes the value you specify in theyourDataPtr
parameter to your filter function. Your filter function also receives as parameters the event record associated with the high-level event and the target ID record that identifies the sender of the event. Your filter function can compare the contents of theyourDataPtr
parameter with any of the other information it receives.If your filter function finds a match, it can call
AcceptHighLevelEvent
if necessary, and then returnTRUE
. If your filter function does not find a match, then it should
returnFALSE
.If your filter function returns
TRUE
, theGetSpecificHighLevelEvent
function returnsTRUE
. If your filter function returnsFALSE
for all high-level events in your application's event queue, or if there are no high-level events in the queue,GetSpecificHighLevelEvent
returnsFALSE
.SPECIAL CONSIDERATIONS
TheGetSpecificHighLevelEvent
function may move or purge memory. You
should not call this function from within an interrupt, such as in a completion routine
or VBL task.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetSpecificHighLevelEvent
function are
Trap macro Selector _OSDispatch $0045 SEE ALSO
See "Filter Function for Searching the High-Level Event Queue" on page 2-114 for more information about how to define a filter function and the parameters thatGetSpecificHighLevelEvent
passes to your filter function.