#
Prev |  | Next

# canvas text

## Name

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

## Synopsis

`canvasId` create text [`-option` `value`...]

## Options

-anchor

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

  Position of the anchor relative to the text.

-coords

  type: list-of-2-floats

  X and y coordinates of the item.

-fill

  type: color with transparancy (default: black)

  Color of the text.

-font

  type: FONT

  Font of the text.

-fontSize

  type: integer

  Font size of the text.

-fontScale

  type: float ORONEOF xx-small, x-small, small, medium, large, x-large, xx-large (default: normal)

  Font scale used.

-fontStretch

  type: ONEOF ultraCondensed, extraCondensed, condensed, semiCondensed, normal, semiExpanded, expanded, extraExpanded, ultraExpanded (default: normal)

  Font stretch of the text.

-fontStyle

  type: ONEOF normal, oblique, italic (default: normal)

  Font style of the text.

-fontVariant

  type: ONEOF normal, smallCaps (default: normal)

  Font variant of the text.

-fontWeight

  type: ONEOF ultralight, light, normal, bold, ultrabold, heavy (default: normal)

  Font weight of the text.

-justify

  type: ONEOF left, right, center, fill (default: left)

  Justification of the text.

-offset

  type: list-of-2-floats (default: {0 0})

  X and y offset of the item.

-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

-parent

  type: tag-or-id

  This option sets the parent of the item. The parent must be a clipGroup item, which implements clipping for its children.

-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.

-text

  type: string (default: "")

  Text to be displayed. If the string starts with "%<" the rest of the string is interpreted as markup string.

## Description

A text item should be used to display text where the hole text has basically the same format. Via a markup string the format can be changed, but for more complex formattig the richText item should be used.

## See also

canvas richText, label, `GnomeCanvasText`

Prev | Home | Next
canvas richText | Up | canvas widget