78
Chapter 9: Application Control Flow
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
default:
EV_defaultHandler(event);
break;
}
}
The application’s main entry point has two parameters — a pointer to the
application’s frame and a pointer to an event notification structure. The
application typically utilizes a
switch
statement to decode what kind of event it
received. The appropriate case label then acts on the event accordingly.
Events which are not picked out by any case label are given default handling by
the routine
EV_defaultHandler
. The application may choose to modify the
default behavior of some events by acting on them then passing them on to
EV_defaultHandler
.
The application relinquishes control to the operating system after handling an
event by returning from its main entry point.
9.2. Event Structure Layout
typedef struct SEvent
{
UINT command;
UINT sourceID;
UINT side;
UINT status;
union
{
EventInfo eventInfo;
KeyInfo keyInfo;
PasteInfo pasteInfo;
PasteHandleInfo pasteHandleInfo;
PaintInfo paintInfo;
StartInfo startInfo;
MenuInfo menuInfo;
ModeInfo modeInfo;
} info;
} Event, *PEvent;
command — A command number encoding which event occurred. This may be,
among others, a keyboard event, a message from the window system,
or an application-to-application message. See the next section
(
9.3. Commands
) for details about each command type.
sourceID — The ID of the application which originated the event—usually the
application which is currently running.