NAME
text - Create and manipulate a text widget.
SYNOPSIS
- text ?-option optionVal ...?
OPTIONS
- -editable
- Determines whether the text is editable.
type: boolean
default: true
- -wordWrap
-
type: boolean
default: true
- -lineWrap
-
type: boolean
default: true
- -scrollbar
- What type of scrollbar the list should have. This can
also be a list of two values where the first value
is the type of the horizontal scrollbar and the
second value is the type of the vertical scrollbar.
Also possible is a boolean value understood by tcl
where true is a synonym for always and
false is a synonym for never.
Because of the shortcomings of the gtk text
widget the horizontal will never show up.
type: always, never, automatic
default: automatic
DESCRIPTION
A position has the form anchor,
anchor+Offset or anchor-Offset.
anchor can be end, cursor,
selectionStart or selectionEnd.
Offset must be an integer value. Example:
cursor+1 or selectionEnd-1.
WIDGET COMMANDS
The text command creates a new Tcl command
whose name is an ID returned on widget creation. This command may be
used to invoke various operations on the widget. It has the following
general form:
ID option ?arg arg ...?
option and arg determine the exact behavior of the
command. The following commands are possible for text widgets:
- ID remove ?startPos endPos?
-
Delete characters from startPos to endPos.
If both position parameters are missing they default to
0 and end, respectively. If only
endPos is missing, it defaults to end.
- ID select ?startPos endPos?
-
Select characters from startPos to endPos.
If both position parameters are missing they default to
0 and end, respectively. If only
endPos is missing, it defaults to end.
- ID cut
-
Cut selected characters to clipboard.
- ID copy
-
Copy selected characters to clipboard.
- ID paste
-
Paste content of clipboard.
- ID getChars ?startPos endPos?
-
Get characters from startPos to endPos.
If both position parameters are missing they default to
0 and end, respectively. If only
endPos is missing, it defaults to end.
- ID getLength
-
Get length of widget content.
- ID setPoint pos
-
Sets the insertion cursor to position pos
- ID getPoint
-
Returns the position of the insertion cursor.
- ID getPosition pos
-
Returns the index of position pos
- ID insert pos text VARARGS
-
Inserts text at position pos. Valid
options are -font, -foreground,
-background.
KEYWORDS
Copyright © 2001 - 2002 P. G. Baum