LispWorks CAPI User Guide > 4 Creating Common Windows > 4.3 Displaying and entering text


4.3.2 Text input panes

When you want the user to enter a line of text -- for instance a search string -- a text input pane can be used.

(setq text (make-instance 'text-input-pane
                          :title "Search: "
                          :callback 'test-callback))
(contain text)

Figure 4.4 A text input pane

Notice that the default title position for text input panes is :left .

You can place text programmatically in the text input pane by supplying a string for the :text initarg, or later by calling (setf text-input-pane-text) in the appropriate process.

You can add toolbar buttons for easier user input via the :buttons initarg. This example allows the user to enter the filename of an existing Lisp source file, either directly or by selecting the file in a dialog raised by the Browse File button. There is also a Cancel button, but the default OK button is not displayed:

  (list :cancel t
        :ok nil
        (list :operation :open
              :filter "*.LISP;*.LSP"))))

For a larger quantity of text use multi-line-text-input-pane .

LispWorks CAPI User Guide (Macintosh version) - 22 Dec 2009