EventSource ( )
Parameters
| None. |
Description
|
Returns the handle of the gadget, window or timer that produced the current event. Requires Extended language mode. This is how one event loop serves a whole interface. Key, mouse and gadget events ($101-$103, $201-$206, $401, $402) carry the gadget's handle; window events ($801-$804) carry the window's; timer ticks ($4001) carry the timer's. Compare it against the handles you kept at creation time: Case $401 If EventSource() = saveButton Then SaveLevel() If EventSource() = nameField Then RenameSelection() Menu actions ($1001) report 0 - identify those by the menu tag in EventData instead - and the application events ($2001-$2005) report 0 too. GUI handles are never reused during a run, so a stale stored handle can never accidentally match a newer gadget. Every sample routes its loop this way; the world editor shell sample is the biggest worked example. See also: EventID, EventData, WaitEvent, PeekEvent, CreateTimer. |
Index