


listener(n)            Tk Built-In Commands           listener(n)


NAME
       listener - Create and manipulate listener widgets

SYNOPSIS
       (listener widget-name ?options?)


WIDGET-SPECIFIC OPTIONS
       Specifies  a STk procedure to associate with the listener.  This proce-
       dure is invoked when a complete s-expr is entered in the listener. This
       s-expr  is  passed  as  a  string  to the procedure. The procedure must
       return the string which will be inserted  in  response  to  the  s-expr
       input.  The  default procedure is the Identity procdure.  Specifies the
       color used the output lines Specifies the color  used  for  the  prompt
       Specifies the prompt used for reading s-expr. Defaults to "> "


DESCRIPTION
       The  listener  procedure  creates  a new text window (given by the wid-
       get-name argument) and associates it bindiangs suitable for a listener.
       Since  a listener is in fact a text widget, all the options of text are
       applicable to a listener.  The  listener  procedure  returns  its  wid-
       get-name  argument.   At the time this procedure is invoked, there must
       not exist a window named widget-name,  but  widget-name's  parent  must
       exist.

       A  listener  is  a  widget for doing interactive I/O. Typical usage for
       this widget consists of a text window whose  inputs  are  sent  to  the
       Scheme  evaluator  and  whose  result  is displayed in the listener. An
       example for this is shown at the end of this page.


WIDGET PROCEDURE
       All the text procedure are avialble for a listener, plus


       (listener-insert-string widget-name str)
              inserts the string str just before the input prompt.

EXAMPLE
       Hereafter is a simple use of the listener widget  which  interact  with
       the evaluator.

       (listener '.t :width   50
                     :height  10
                     :command (lambda (x)
                                (eval-string  x  (global-environment)))) (pack
       .t)


DEFAULT BINDINGS
       The defaults bindings are identical to the text bindings.





STk                            3.1                              1





listener(n)            Tk Built-In Commands           listener(n)


SEE ALSO
       text























































STk                            3.1                              2


