
37
Class Reference
4.2.1.2
confirm
The gui.confirm function displays text in the display area of the standard GUI display and
returns a value based on the key pressed. Do not call this function within onDecode and
onCommand event handlers.
Format:
gui.confirm(yesFunc, noFunc, text, title,
leftSoftkeyLabel, rightSoftkeyLabel);
Where:
yesFunc
– function name; function to be called when the confirm receives left softkey.
This function does not take any arguments and returns void.
noFunc
– function name; function to be called when the confirm receives right softkey.
This function does not take any arguments and returns void.
text
– string; text to display for confirmation.
title
– string; text to display in the gui object status bar; defaults to “Confirm.”
leftSoftkeyLabel
– string; text to use as label for the left softkey (default is "Yes").
rightSoftkeyLabel
– string; text to use as label for the right softkey (default is "No").
Processing suspends until the operator presses an enter key or cancel key.
Example:
gui.confirm(onYesClick, onNoClick, "Exit?", "guiConfirm");
Displays the confirm dialog shown in Figure 8 and waits until the operator presses the
enter key or the left softkey. If operator presses Yes key, it calls onYesClick function. If
operator presses No key, it calls onNoClick function to continue processing.
Figure 8 – gui.Confirm Example