The prompt-for-symbol
function pops up a text input pane and prompts the user for a symbol. The symbols that are valid can be constrained in a number of ways.
This function prompts the user for a symbol which they should type into a string prompter. The symbols that are valid can be constrained in a number of ways. The keyword arguments are a list of all valid symbols, a package in which the symbol must be available, and an ok-check function which when called on a symbol will return non- nil
if the symbol 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-symbol "Enter a symbol:")
(capi:prompt-for-symbol "Enter a symbol:"
:package 'cl)
(capi:prompt-for-symbol "Enter a symbol:"
:symbols
'(foo bar baz))
(capi:prompt-for-symbol "Enter a symbol:"
:ok-check #'(lambda (symbol)
(string< symbol "B")))