The prompt-for-integer
function pops up a text input pane and prompts the user for an integer.
This function prompts the user for an integer which is returned, and the initial-value will appear in the input pane. When min or max are specified the allowable result is constrained accordingly, and more complicated restrictions can be applied using the function ok-check which gets passed the currently entered number, and should return t
if it is valid.
Finally, as with all of the prompting functions, the prompter is created by passing an appropriate pane (in this case a text input pane) to popup-confirmer
. Arguments can be passed to the make-instance
of the pane and the call to popup-confirmer
using pane-args and popup-args respectively.
(capi:prompt-for-integer "Enter an integer:")
(capi:prompt-for-integer "Enter an integer:" :max 10)
(capi:prompt-for-integer "Enter an integer:"
:min 100 :max 200)
(capi:prompt-for-integer "Enter an integer:"
:ok-check 'evenp)