StdGUI Event Functions
int run_event_loop(int *p_retval);
int end_event_loop(int p_retval);
int poll_mouse(int *p_xpos, int *p_ypos, int *p_buttons);
int set_key_focus(WIDGET *p_wgt);
int end_key_focus(WIDGET *p_wgt);
int follow_mouse(WIDGET *p_wgt);
int ignore_mouse(WIDGET *p_wgt);
The run_event_loop() function starts the main event loop for the application and all of its windows (and other GUI objects). This loop will invoke the callback functions for each window and widget as required by user actions.
The end_event_loop() function terminates the running event loop, causing it to return the value specified in p_retval.
The poll_mouse() function returns the current state of the mouse: position in p_xpos and p_ypos and mouse button states in p_buttons).
The set_key_focus() and end_key_focus() functions control which UI widget receives keyboard events.
The follow_mouse() and ignore_mouse() functions control when mouse movement events are generated and what UI widget receives those events.
EVT_NULL − no event
EVT_REDRAW and REDRAW_MASK − redraw the window or widget (handler specified by ON_REDRAW and ON_REDRAW_PARAM)
EVT_RESIZE and RESIZE_MASK − the window has been resized (handler specified by ON_RESIZE and ON_RESIZE_PARAM)
EVT_CLOSE and CLOSE_MASK − the window has been closed (handler specified by ON_CLOSE and ON_CLOSE_PARAM)
EVT_MOUSEDOWN and MOUSEDOWN_MASK − a mouse button was pressed down (handler specified by ON_MOUSEDOWN and ON_MOUSEDOWN_PARAM)
EVT_MOUSEUP and MOUSEUP_MASK − a mouse button was released (handler specified by ON_MOUSEUP and ON_MOUSEUP_PARAM)
EVT_MOUSEMOVE and MOUSEMOVE_MASK − the mouse has been moved (handler specified by ON_MOUSEMOVE and ON_MOUSEMOVE_PARAM)
EVT_KEYDOWN and KEYDOWN_MASK − a keyboard key has been pressed down (handler specified by ON_KEYDOWN and ON_KEYDOWN_PARAM)
EVT_KEYUP and KEYUP_MASK − a keyboard key has been released (handler specified by ON_KEYUP and ON_KEYUP_PARAM)
EVT_FOCUS and FOCUS_MASK − a window or widget has gotten focus (handler specified by ON_FOCUS and ON_FOCUS_PARAM)
EVT_BLUR and BLUR_MASK − a window or widget has lost focus (handler specified by ON_BLUR and ON_BLUR_PARAM)
EVT_TIMER and TIMER_MASK − a time tick has occurred (handler specified by ON_TIMER and ON_TIMER_PARAM)
EVT_USER and USER_MASK − a user event has occurred (handler specified by ON_USER and ON_USER_PARAM)
EVT_SYSTEM and SYSTEM_MASK − a system event has occurred (handler specified by ON_SYSTEM and ON_SYSTEM_PARAM)
All event functions return zero (0) on success, non-zero on failure.