canvas richText

Name

canvas richText -- A canvas rich text item. (in gnoclCanvas)

Synopsis

canvasId create richText [-option value...]

Options

-coords

type: list-of-floats

X and y coordinates of the item.

-text

type: string (default: "")

Text to be displayed.

-width

type: integer

Width of of the item in pixel.

-height

type: integer

Height of of the item in pixel.

-editable

type: boolean (default: 1)

Whether the the text is editable.

-visible

type: boolean (default: 1)

Whether the text is visible.

-cursorVisible

type: boolean (default: 1)

Whether the cursor is visible.

-cursorBlink

type: boolean (default: 1)

Whether the cursor is blinking.

-growHeight

type: boolean (default: 1)

Whether the the height of the item should increase if there is not enough space to display the whole text.

-wrapMode

type: ONEOF none, char, word

Wrap mode used for the rendering of the cells.

-justify

type: ONEOF left, right, center, fill

Justification of the lines in one cell.

-anchor

type: ONEOF center, N, NW, NE, S, SW, SE, W, E (default: center)

Position of the anchor relative to the text.

-pixelsBelowLines

type: integer

Pixels below lines.

-pixelsInsideWrap

type: integer

Pixels between lines after wrap.

-pixelsAboveLines

type: integer

Pixels above lines.

-leftMargin

type: integer (default: 0)

Left margin of the text inside the item.

-rightMargin

type: integer (default: 0)

Right margin of the text inside the item.

-indent

type: integer (default: 0)

Indention

-onButtonPress

type: string (default: "")

Tcl command which is executed if a mouse button is press inside the item. Before evaluation the following percent strings are substituated: TABLE %% | % %w | canvas name %i | item id %t | type of event: one of buttonPress, button2Press or button3Press %x | x coordinate %y | y coordinate %b | button number %s | state of the buttons and modifiers (bitmask) TABLE

-onButtonRelease

type: string (default: "")

Tcl command which is executed if a mouse button is released if it has been pressed inside the item. Before evaluation the following percent strings are substituated: TABLE %% | % %w | canvas name %i | item id %t | type of event: always buttonRelease %x | x coordinate %y | y coordinate %b | button number %s | state of the buttons and modifiers (bitmask) TABLE

-onEnter

type: string (default: "")

Tcl command which is executed if a mouse enters the item. Before evaluation the following percent strings are substituated: TABLE %% | % %w | canvas name %i | item id %x | x coordinate %y | y coordinate %s | state of the buttons and modifiers (bitmask) TABLE

-onLeave

type: string (default: "")

Tcl command which is executed if a mouse enters the item. Before evaluation the following percent strings are substituated: TABLE %% | % %w | canvas name %i | item id %x | x coordinate %y | y coordinate %s | state of the buttons and modifiers (bitmask) TABLE

-onMotion

type: string (default: "")

Tcl command which is executed if the mouse is moved inside the item. Before evaluation the following percent strings are substituated: TABLE %% | % %w | canvas name %i | item id %x | x coordinate %y | y coordinate %s | state of the buttons and modifiers (bitmask) TABLE

-tags

type: list (default: "")

List of tags to be associated with this item. A tag must start with a alphabetic character which is followed by zero or more alphabetic or numeric characters.

Description

The richText item is the adaption of the text widget to the canvas.

Commands

canvasId itemCommand tagOrId erase startIndex ?endIndex?

Removes all text between startIndex and endIndex. endIndex defaults to end.

canvasId itemCommand tagOrId select startIndex ?endIndex?

Select the text between startIndex and endIndex. endIndex defaults to end.

canvasId itemCommand tagOrId get startIndex ?endIndex?

Returns the text between startIndex and endIndex. endIndex defaults to end.

canvasId itemCommand tagOrId cut

Copies all text to the clipboard and removes it from the widget.

canvasId itemCommand tagOrId copy

Copies all text to the clipboard.

canvasId itemCommand tagOrId paste

Pastes text from the clipboard at the current cursor position.

canvasId itemCommand tagOrId getLength

Returns the number of characters in the widget.

canvasId itemCommand tagOrId getCursor

Returns the position position of the cursor as list of its row and column.

canvasId itemCommand tagOrId setCursor index

Sets the cursor to position index.

canvasId itemCommand tagOrId insert index text ?-tags taglist?

Inserts and position indext the text text. If taglist is given the text is taged with each element of the list.

canvasId itemCommand tagOrId tag create tagName [-option value...]

Creates a tag with name tagName and configures it dependent of the options given. The options are the same as with tag configure.

canvasId itemCommand tagOrId tag configure tagName [-option value...]

Configures the existing tag tagName. See text for options.

See also

canvas text, text, GnomeCanvasRichText