XTkEditWidgets.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Defines a stream widget class enabling ascii output.
Philip James, March 18, 1992 10:13 am PST
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE],
XTk USING [Widget, WidgetSpec];
XTkEditWidgets: CEDAR DEFINITIONS ~
BEGIN
GetText: PROC [widget: XTk.Widget] RETURNS [text: Rope.ROPE, did: BOOL ¬ TRUE];
SetText: PROC [widget: XTk.Widget, text: Rope.ROPE] RETURNS [BOOL ¬ TRUE];
SelectionLocation: TYPE ~ {before, after};
SetSelection: PROC [widget: XTk.Widget, start, length: INT ¬ FIRST[INT], where: SelectionLocation ¬ before];
CreateEditWidget: PROC [widgetSpec: XTk.WidgetSpec ¬ [], scrollable: BOOL ¬ FALSE, backingHeight: INT ¬ FIRST[INT], keyboardAccepting: BOOL ¬ TRUE, widgetStream: IO.STREAM ¬ NIL] RETURNS [XTk.Widget];
Creates a stream widget, enabling ascii output.
If widgetStream is not NIL, its output will be directed to the created widget.
scrollable enables scroll bars
backingHeight sets size of scrollable area.
keyboardAccepting allows keyboard input
QueryKeyboardAccepting: PROC [w: XTk.Widget] RETURNS [ans: BOOL ¬ FALSE];
EnableKeyboardInput: PROC [w: XTk.Widget];
DisableKeyboardInput: PROC [w: XTk.Widget];
CreateStream: PROC [w: XTk.Widget ¬ NIL] RETURNS [widgetStream: IO.STREAM];
Creates a new widgetStream stream which can direct its output into arbitrary stream-widgets. If w is not NIL the new stream will direct its output into w.
Stream might discard characters until widget is attached, created and widget is realized.
BindStream: PROC [w: XTk.Widget, widgetStream: IO.STREAM];
Further output into widgetStream is directed into w.
END.