Input provides tools to let the window manager read a line of
input from the user and act on it. It provides a subclass of
KeyGrabKeyboard (see section
keys Extension Module) for configuration, and two
classes to read input.
Creates a key handler class for editing input. The handler is
any object acceptable to
.show(left, right) is called to
display the two strings with a curser between
.do(text) is called when the user is
through editing the input. displayer
.abort() is called if
the user aborts the operation.
InputKeyHandler provides the following methods that may be
bound to keystrokes like any other keyhander. See section
keys Extension Module.
eventis inserted into the buffer at the cursor. All the characters of the latin1 character set are bound to this by default.
handlermust be an instance of
wmanager.Window. If that is not the case, or no text is currently selected, this does nothing.
displayer.dopassing it the edited text.
inputWindow is a class that creates a window on screen
and uses an
InputKeyHandler to read input from the user. The
user is prompted with prompt. Space is left for length
extra characterfs to display in the window, but it will scroll to keep
the cursor always in view.
The attributes of the window used to read the input. The defaults are 9x15 for the fontname, a black foreground on a white background, and a borderwidth of 3.
The height and width of the window will be available as
attributes after the
inputWindow is instantiated.
The read method of the inputWindow is called to read text from user
and act on it. handlertype should be a subclass of
InputKeyHandler with appropriate bindings for editing the
text. action will be invoked with the edited text as it's sole
argument when handlertypes's
_done action is invoked.
modeInput object uses the
modewindow on screen
to read input from the user. See section
modewindow Extension Module. It has an
method that takes the same arguments as the
read method of
inputWindow, except that x and y are ignored.
Go to the first, previous, next, last section, table of contents.