[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Filtering editable-text-dialog-item's



    ... how to filter an editable-text-dialog-item such that a user can
    only enter a number.

You might let users do all their typing (non-number input included)
then check when they indicate they're done (i.e. when they hit the "Do
It" button). You check if lisp can read-from-string the thing as a
number: (numberp (read-from-string their-input-string)). If not then
indicate bad input (i.e. beep and a message dialog) and let them
continue editing. You could attach the action to the "Do It" button if
you're using a modal dialog, or to window-close if you have a close box.

matt