The file READNUMBER in the library contains functions for implementing a calculator type menu for getting numbers from the user.  

(RNUMBER MSG POSITION MSGFONT DIGITFONT INCLUDEABORTFLG)                  [function]
brings up a menu that looks like a calculator number pad.  The user's selections on the digits are accumulated in a displayed total.  The number pad includes a backspace key (bs), a clear key (clr) and an +/- key (-).  When 'ok' is selected, the total is returned.

If INCLUDEABORTFLG is non-NIL, the menu will also include an abort key (abt).  If the abort key is pressed, RNUMBER returns NIL.

If MSG is given, it is printed at the top of the menu.

If POSITION is a position, the menu will be put there; otherwise it will be put under the cursor.

If MSGFONT is a font, MSG will be printed in it.

If DIGITFONT is a font, the labels on the number pad keys will be printed in it.  The default for MSGFONT is '(helvetica 12).  The default for DIGITFONT is '(Helvetica 18).

If the user closes the number pad window, the action taken by RNUMBER depends upon the value of INCLUDEABORTFLG.  If INCLUDEABORTFLG is NIL, RNUMBER generates an error (i.e. calls (ERROR!)).  If INCLUDEABORTFLG is non-NIL, RNUMBER return NIL (the same thing it does if the abort key is pressed.)

Example of use:

(RNUMBER '(How many WIDGITS would you like?))

For some applications, it may be beneficial to avoid the creation of the number pad menu window each time a number is asked for.  The following two function allow the user to create a number pad menu window that can be saved and to use that window repeatedly to get values from the user.  Note: when used in this manner, a number pad menu window can only be used by one process at a time.

(CREATE.NUMBERPAD.READER MSG WPOSITION MSGFONT DIGITFONT INCLUDEABORTFLG) [function]

Creates a window suitable for use by NUMBERPAD.READ (see below).  Its arguments are the same as for the function RNUMBER.

(NUMBERPAD.READ NUMBERPAD/READER) [function]

NUMBERPAD/READER should be a window returned by the function CREATE.NUMBERPAD.READER (see above).  NUMBERPAD.READ uses the window in the same manner as the function RNUMBER.