Packages‎ > ‎gnocl::canvas‎ > ‎

bPath

A canvas item which consists of line and bezier segments. (in gnoclCanvas)

Synopsis

canvasId create bPath [-option value...]

Options

-capStyle
type: ONE OF notLast, but, round or projecting
Defines the cap style.
-coords
type: list-of-graphic-commands-and-floats
List of graphic commands and corresponding coordinates. Valid graphic commands are "lineTo", "lineToMoving", "moveTo", "curveTo", "close" and "closeCurrent". The list must start with either the "moveTo" graphic command followed by an x and an y coordinate, or by an x and an y coordinate. "lineTo" must be followed by an x and an y coordinate. It draws a straight line from the last point to (x,y). And makes (x,y) the current point. "lineToMoving" is the same as "lineTo" apart from that if several "lineToMoving" commands follow each other, only the last one is actually drawn. This is for example usefull in interactive drawing. "moveTo" must be followed by an x and an y coordinate. It makes (x,y) the current point. "curveTo" must be followed by six coordinates. It draws a Bezier curve. And make the last point the current point. "close" must not be followed by any coordinates. It closes the current figure with a straight line to the last point set by the "moveTo" command. "closeCurrent" must not be followed by any coordinates. It closes the current figure by changing the current point to the last point set by the "moveTo" command. A path may contain multiple "moveTo" and "close" commands, so that it is possible to draw multiple figures with one canvasBPath item. Examples: "100 100 lineTo 150 50 lineTo 200 100 close" draws a triangle; "moveTo 10 120 curveTo 10 220 110 220 110 120" draws a Bezier curve.
-dash
type: list (default: "")
Dash pattern used for this item. The list must contain an even number of integer. The odd elements of this list give the length in pixel of the line segements, the even elements give the length of the space between these line segements.
-fill
type: color with transparancy (default: black)
Color of the curve.
-joinStyle
type: ONEOF miter, round, bevel
Defines the join style.
-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:
%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)
-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 substituted:
%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)
-onEnter
type: string (default: "")
Tcl command which is executed if a mouse enters the item. Before evaluation the following percent strings are substituated:
%w    canvas name
%i    item id
%x    x coordinate
%y    y coordinate
%s    state of the buttons and modifiers (bitmask)
-onLeave
type: string (default: "")
Tcl command which is executed if a mouse enters the item. Before evaluation the following percent strings are substituated:
%w    canvas name
%i    item id
%x    x coordinate
%y    y coordinate
%s    state of the buttons and modifiers (bitmask)
-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:
%w    canvas name
%i    item id
%x    x coordinate
%y    y coordinate
%s    state of the buttons and modifiers (bitmask)
-outline
type: color with transparancy (default: black)
Outline color of the curve.
-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.
-pixelWidth
type: integer
Width of the line, does not change, if the line is scaled.
-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.
-width
type: float
Width of the line, changes, if the line is scaled.

Description

A bezier path consists of one or more elements consisting of lines and bezier curves. The elements may be open or closed. In the latter case they may be filled with a color.

Commands

canvasId itemCommand tagOrId appendCoords list-of-graphic-commands-and-floats
Adds list-of-graphic-commands-and-floats to the existing coordinates. See option "-coords" for a description of valid graphic commands. This command is especially usefull for interactive drawing, where the graphic command "lineToMoving" draws a line from the last current point set by "lineTo", "curveTo" or "moveTo" and each appended "lineToMoving" replaces its successor.



Comments