Skip to content
Chris Petersen edited this page Oct 16, 2014 · 2 revisions

glgui-event process an input event. It loops over all guis provided and sends events to their widgets's input handlers. It is mainly found in the second function (the loop) of the main program declaration.

Parameter Description
g Graphical User Interface (GUI) or a list of GUIs
t Event type, e.g. EVENT_KEYPRESS
x0 First argument of event, e.g. x coordinate pixels or keyboard character
y0 Second argument of event, e.g. y coordinate in pixels

Example

Example from apps/DemoRedSquare/main.scm

(lambda (t x y) 
  (if (= t EVENT_KEYPRESS) (begin (if (= x EVENT_KEYESCAPE) (terminate))))
  (glgui-event gui t x y)
)

Clone this wiki locally