GuiGetEvent
|
GUI functions |
SYNTAX | GuiGetEvent( num, what = 0 ) |
RETURNS | NUMBER or STRING |
FUNCTION | The function retrieves queued GUI event (such as click, edit change, focus change, etc) that
was triggered by on-chart GUI control Parameters:
Usually there is zero (when formula execution was not triggered by UI event) or one event in the queue but note that there can be more than one event notification in the queue if your formula is slow to process. To retrieve them all use increasing "num" parameter as long as GuiGetEvent does not return zero (in what =0, =1 mode) or empty string (what=2). For more information about using GUI controls see Tutorial: Using on-chart GUI controls |
EXAMPLE | // EXAMPLE 1. Just read all pending events
It is good practice to have a separate function that handles the events as shown below: // EXAMPLE 2. Read and handle events using switch statement |
SEE ALSO | GuiButton() function , GuiCheckBox() function , GuiDateTime() function , GuiEdit() function , GuiRadio() function , GuiSlider() function , GuiToggle() function |
The GuiGetEvent function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.