listener
Section: Tk Built-In Commands (n)
Updated: 3.1
Index
Return to Main Contents
NAME
listener - Create and manipulate listener widgets
SYNOPSIS
(listener widget-name ?options?)
WIDGET-SPECIFIC OPTIONS
[ :command command ]
Specifies a STk procedure to associate with the listener. This procedure
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.
[ :output-color output-color ]
Specifies the color used the output lines
[ :prompt-color prompt-color ]
Specifies the color used for the prompt
[ :prompt prompt ]
Specifies the prompt used for reading s-expr. Defaults to "> "
DESCRIPTION
The listener procedure creates a new text window (given by the
widget-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
widget-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.
SEE ALSO
text
Index
- NAME
-
- SYNOPSIS
-
- WIDGET-SPECIFIC OPTIONS
-
- DESCRIPTION
-
- WIDGET PROCEDURE
-
- EXAMPLE
-
- DEFAULT BINDINGS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 15:21:49 GMT, November 05, 2024