A canvas rectangle item. (in
gnoclCanvas)
Synopsis
canvasId create rectangle [-option
value...]
Options
- -centerRadius
-
type: boolean (default: 0)
-
Whether the coordinates are a list of the top left and bottom right
points, or a list of the coordinates of the centre plus a radius.
-
-coords
-
type: list-of-floats
-
List of 4 (x1, y1, x2, y2) or, if centerRadius is set, 3 (centerX,
centerY, radius) coordinates
-
-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 segments, the even elements give the length of
the space between these line segments.
-
-fill
-
type: color with transparency
(default: black)
-
Fill color of the rectangle. The empty string means unfilled.
-
-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.
-
-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 substituted:
- %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 substituted:
- %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 substituted:
- %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 substituted:
- %w canvas name
%i item id %x coordinate %y y
coordinate %s state of the buttons and modifiers (bitmask)
-
-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.
-
-outline
-
type: color with transparancy
(default: black)
-
Outline color of the rectangle.
-
-width
-
type: float
-
Width of the outline.
Description
A rectangle is define either by its top left and bottom right
points, or by its center point and a radius. The rectangle can be
filled, or only outlined.
See also
|
|