• 検索結果がありません。

Text Widget Options

ドキュメント内 tcl tk reference guide (ページ 125-128)

Standard

See Common Options and Resources in Options and Resources for full details.

-background -highlightthickness -relief

-borderwidth -insertbackground -selectbackground

-cursor -insertborderwidth -selectborderwidth

-exportselection -insertofftime -selectforeground

-font -insertontime -setgrid

-foreground -insertwidth -takefocus

-highlightbackground -padx -xscrollcommand

-highlightcolor -pady -yscrollcommand

Text Widget Specific

See Coordinates in Options and Resources for screen unit options.

Configure Option Resource Name Resource Class Description

-autoseparators boolean autoSeparators AutoSeparators (Tk 8.4+) Specifies whether separators are automatically inserted in the undo stack.

Used with -undo. Common to all peers.

-blockcursor blockCursor BlockCursor

(Tk 8.5+) Specifies whether the insertion cursor should be drawn as a block (true) or thin vertical line (false or default).

-endline endLine EndLine

(Tk 8.5+) Specifies index of the last line of the underlying textual data store that should be shown. Default is {}, which sets the end to after the last line.

-height size height Height Height of text widget in lines of -font sized

text.

-inactiveselectionbackground inactiveSelectionBackground Foreground

(Tk 8.5+) Specifies color of the selection, or {} for no selection, when the window does not have the input focus.

-maxundo count maxUndo MaxUndo (Tk 8.4+) Specifies the max number of

compound undo actions on the undo stack.

If count <= 0, use an unlimited undo stack.

Common to all peers.

-spacing1 size spacing1 Spacing1 Space in screen units above first line of a paragraph.

-spacing2 size spacing2 Spacing2 Space in screen units between lines within a paragraph.

-spacing3 size spacing3 Spacing3 Space in screen units below the last line of a paragraph.

-startline startLine StartLine

(Tk 8.5+) Specifies index of the first line of the underlying textual data store that should be shown. Default is {}, which sets the start to before the first line.

-state state state State State of text widget. Options are: disabled

or normal.

-tabs tabList tabs Tabs Specifies a list of tab stops consisting of

offset values from the left edge in screen units followed by an optional justification of either left (default) with the left edge of text at tab position, right with text at tab position, center with the text centered at the tab position, or numeric with decimal point in the text is positioned at the tab position. If set to { } the default 8-character tab stops are used.

-undo boolean undo Undo (Tk 8.4+) Specifies whether the undo

mechanism is active. Common to all peers.

-width size width Width Width of text widget in -font sized

characters. For proportional fonts, width of

"0" is used.

-wrap type wrap Wrap Specifies how to wrap lines wider than the

window. Options are: char (line break can be made after any character), none (no wrap), or word (line break can only be made at word boundaries).

Indicies or Character Positions:

Some text widget commands support the use of an index to locate the position of characters within the text widget. Indicies have the syntax:

base modifier modifier modifier ...

The following are the valid forms for base:

Base Description

line.char Indicates line line (starts at 1) and character char (starts at 0).

@x,y Indicates the character that covers the pixel at position x and y.

end Indicates the character at the end of the text, just after the newline.

mark Indicates the character just after the mark whose name is mark.

tag.first Indicates the first character in the text that has been tagged with tag. If no characters are tagged, an error will be generated.

tag.last Indicates the character just after the last one in the text that has been tagged with tag. If no characters are tagged, an error will be generated.

pathName Indicates the position of the embedded window whose name is pathName. If pathName doesn’t exist, an error is generated.

imageName Indicates the position of the embedded image whose name is imageName. If imageName doesn’t exist, an error is generated.

The following are the valid forms for modifier:

Modifier Description

+count

?submodifer?

chars

Adjust the index forward by count characters, moving to later lines in the text if necessary or to the last character in the text if fewer than count characters remain. In Tk 8.5+, use the display submodifier to skip and not count elided characters and any to count all characters (default).

-count

?submodifer?

chars

Adjust the index backwards by count characters, moving to earlier lines in the text if necessary or to the first character in the text if fewer than count characters remain. In Tk 8.5+, use the submodifier display to skip and not count elided characters and any to count all characters (default).

+count

?submodifer?

indicies

(Tk 8.5+) Adjust the index forward by count index positions, moving to later lines in the text if necessary. If there are fewer than count index positions in the text after the current index, then set the index to the last index position in the text. In Tk 8.5+, use the submodifier display to skip and not count elided indicies and any to count all indicies (default)

.

-count

?submodifer?

indicies

(Tk 8.5+) Adjust the index backward by count index positions, moving to earlier lines in the text if necessary. If there are fewer than count index positions in the text before the current index, then set the index to the first index position (1.0) in the text. In Tk 8.5+, use the submodifier display to skip and not count elided indicies and any to count all indicies (default).

+count

?submodifer?

lines

Adjust the index forward by count lines or to the last line if less than count remain, without changing the character position within the line or to the last character in the line (newline char) if fewer characters than the character position are available. In In Tk 8.5+, use the submodifier display to count visual lines and any to count logical lines (default).

-count

?submodifer?

lines

Adjust the index backwards by count lines or to the first line if less than count remain, without changing the character position within the line or to the last character in the line (newline char) if fewer characters than the character position are available. In In Tk 8.5+, use the submodifier display to count visual lines and any to count logical lines (default).

linestart Adjust the index to refer to the first character on the line.

lineend Adjust the index to refer to the last character on the line (newline char).

wordstart Adjust the index to refer to the first character of the word (consists of letters, digits, underscores, or any other single char) containing the current index.

wordend Adjust the index to refer to the last character of the word (consists of letters, digits, underscores, or any other single char) containing the current index.

ドキュメント内 tcl tk reference guide (ページ 125-128)

関連したドキュメント