Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Canvas.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "CANVAS 1"
132.TH CANVAS 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::Canvas \- Create and manipulate Canvas widgets
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137\&\fI$canvas\fR = \fI$parent\fR\->\fBCanvas\fR(?\fIoptions\fR?);
138.SH "STANDARD OPTIONS"
139.IX Header "STANDARD OPTIONS"
140\&\fB\-background\fR \fB\-highlightthickness\fR \fB\-insertwidth\fR \fB\-state\fR
141\&\fB\-borderwidth\fR \fB\-insertbackground\fR \fB\-relief\fR \fB\-tile\fR
142\&\fB\-cursor\fR \fB\-insertborderwidth\fR \fB\-selectbackground\fR \fB\-takefocus\fR
143\&\fB\-highlightbackground\fR \fB\-insertofftime\fR \fB\-selectborderwidth\fR \fB\-xscrollcommand\fR
144\&\fB\-highlightcolor\fR \fB\-insertontime\fR \fB\-selectforeground\fR \fB\-yscrollcommand\fR
145.SH "WIDGET-SPECIFIC OPTIONS"
146.IX Header "WIDGET-SPECIFIC OPTIONS"
147.IP "Name: \fBcloseEnough\fR" 4
148.IX Item "Name: closeEnough"
149.PD 0
150.IP "Class: \fBCloseEnough\fR" 4
151.IX Item "Class: CloseEnough"
152.IP "Switch: \fB\-closeenough\fR" 4
153.IX Item "Switch: -closeenough"
154.PD
155Specifies a floating-point value indicating how close the mouse cursor
156must be to an item before it is considered to be ``inside'' the item.
157Defaults to 1.0.
158.IP "Name: \fBconfine\fR" 4
159.IX Item "Name: confine"
160.PD 0
161.IP "Class: \fBConfine\fR" 4
162.IX Item "Class: Confine"
163.IP "Switch: \fB\-confine\fR" 4
164.IX Item "Switch: -confine"
165.PD
166Specifies a boolean value that indicates whether or not it should be
167allowable to set the canvas's view outside the region defined by the
168\&\fBscrollRegion\fR argument.
169Defaults to true, which means that the view will
170be constrained within the scroll region.
171.IP "Name: \fBheight\fR" 4
172.IX Item "Name: height"
173.PD 0
174.IP "Class: \fBHeight\fR" 4
175.IX Item "Class: Height"
176.IP "Switch: \fB\-height\fR" 4
177.IX Item "Switch: -height"
178.PD
179Specifies a desired window height that the canvas widget should request from
180its geometry manager. The value may be specified in any
181of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section below.
182.IP "Name: \fBscrollRegion\fR" 4
183.IX Item "Name: scrollRegion"
184.PD 0
185.IP "Class: \fBScrollRegion\fR" 4
186.IX Item "Class: ScrollRegion"
187.IP "Switch: \fB\-scrollregion\fR" 4
188.IX Item "Switch: -scrollregion"
189.PD
190Specifies a list with four coordinates describing the left, top, right, and
191bottom coordinates of a rectangular region.
192This region is used for scrolling purposes and is considered to be
193the boundary of the information in the canvas.
194Each of the coordinates may be specified
195in any of the forms given in the \*(L"\s-1COORDINATES\s0\*(R" section below.
196.IP "Name: \fBstate\fR" 4
197.IX Item "Name: state"
198.PD 0
199.IP "Class: \fBState\fR" 4
200.IX Item "Class: State"
201.IP "Switch: \fB\-state\fR" 4
202.IX Item "Switch: -state"
203.PD
204Modifies the default state of the canvas where \fIstate\fR may be set to one of:
205normal, disabled, or hidden. Individual canvas objects all have their own
206state option, which overrides the default state. Many options can take
207separate specifications such that the appearance of the item can be different
208in different situations. The options that start with \*(L"active\*(R" control the
209appearence when the mouse pointer is over it, while the option starting
210with \*(L"disabled\*(R" controls the appearence when the state is disabled.
211.IP "Name: \fBwidth\fR" 4
212.IX Item "Name: width"
213.PD 0
214.IP "Class: \fBwidth\fR" 4
215.IX Item "Class: width"
216.IP "Switch: \fB\-width\fR" 4
217.IX Item "Switch: -width"
218.PD
219Specifies a desired window width that the canvas widget should request from
220its geometry manager. The value may be specified in any
221of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section below.
222.IP "Name: \fBxScrollIncrement\fR" 4
223.IX Item "Name: xScrollIncrement"
224.PD 0
225.IP "Class: \fBScrollIncrement\fR" 4
226.IX Item "Class: ScrollIncrement"
227.IP "Switch: \fB\-xscrollincrement\fR" 4
228.IX Item "Switch: -xscrollincrement"
229.PD
230Specifies an increment for horizontal scrolling, in any of the usual forms
231permitted for screen distances. If the value of this option is greater
232than zero, the horizontal view in the window will be constrained so that
233the canvas x coordinate at the left edge of the window is always an even
234multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling
235(e.g., the change in view when the left and right arrows of a scrollbar
236are selected) will also be \fBxScrollIncrement\fR. If the value of
237this option is less than or equal to zero, then horizontal scrolling
238is unconstrained.
239.IP "Name: \fByScrollIncrement\fR" 4
240.IX Item "Name: yScrollIncrement"
241.PD 0
242.IP "Class: \fBScrollIncrement\fR" 4
243.IX Item "Class: ScrollIncrement"
244.IP "Switch: \fB\-yscrollincrement\fR" 4
245.IX Item "Switch: -yscrollincrement"
246.PD
247Specifies an increment for vertical scrolling, in any of the usual forms
248permitted for screen distances. If the value of this option is greater
249than zero, the vertical view in the window will be constrained so that
250the canvas y coordinate at the top edge of the window is always an even
251multiple of \fByScrollIncrement\fR; furthermore, the units for scrolling
252(e.g., the change in view when the top and bottom arrows of a scrollbar
253are selected) will also be \fByScrollIncrement\fR. If the value of
254this option is less than or equal to zero, then vertical scrolling
255is unconstrained.
256.SH "DESCRIPTION"
257.IX Header "DESCRIPTION"
258The \fBCanvas\fR method creates a new window (given
259by the \f(CW$canvas\fR argument) and makes it into a canvas widget.
260Additional options, described above, may be specified on the
261command line or in the option database
262to configure aspects of the canvas such as its colors and 3\-D relief.
263The \fBcanvas\fR command returns its
264\&\f(CW$canvas\fR argument. At the time this command is invoked,
265there must not exist a window named \f(CW$canvas\fR, but
266\&\f(CW$canvas\fR's parent must exist.
267.PP
268Canvas widgets implement structured graphics.
269A canvas displays any number of \fIitems\fR, which may be things like
270rectangles, circles, lines, and text.
271Items may be manipulated (e.g. moved or re\-colored) and
272callbacks may
273be associated with items in much the same way that the bind
274method allows callbacks to be bound to widgets. For example,
275a particular callback may be associated with the \fB<Button\-1>\fR event
276so that the callback is invoked whenever button 1 is pressed with
277the mouse cursor over an item.
278This means that items in a canvas can have behaviors defined by
279the Callbacks bound to them.
280.SH "DISPLAY LIST"
281.IX Header "DISPLAY LIST"
282The items in a canvas are ordered for purposes of display,
283with the first item in the display list being displayed
284first, followed by the next item in the list, and so on.
285Items later in the display list obscure those that are
286earlier in the display list and are sometimes referred to
287as being \fI``on top''\fR of earlier items.
288When a new item is created it is placed at the end of the
289display list, on top of everything else.
290Widget methods may be used to re-arrange the order of the
291display list.
292.PP
293Window items are an exception to the above rules. The underlying
294window systems require them always to be drawn on top of other items.
295In addition, the stacking order of window items
296is not affected by any of the canvas methods; you must use
297the raise and lower Tk widget methods instead.
298.SH "ITEM IDS AND TAGS"
299.IX Header "ITEM IDS AND TAGS"
300Items in a canvas widget may be named in either of two ways:
301by id or by tag.
302Each item has a unique identifying number which is assigned to
303that item when it is created. The id of an item never changes
304and id numbers are never re-used within the lifetime of a
305canvas widget.
306.PP
307Each item may also have any number of \fItags\fR associated
308with it. A tag is just a string of characters, and it may
309take any form except that of an integer.
310For example, ``x123'' is \s-1OK\s0 but ``123'' isn't.
311The same tag may be associated with many different items.
312This is commonly done to group items in various interesting
313ways; for example, all selected items might be given the
314tag ``selected''.
315.PP
316The tag \fBall\fR is implicitly associated with every item
317in the canvas; it may be used to invoke operations on
318all the items in the canvas.
319.PP
320The tag \fBcurrent\fR is managed automatically by Tk;
321it applies to the \fIcurrent item\fR, which is the
322topmost item whose drawn area covers the position of
323the mouse cursor.
324If the mouse is not in the canvas widget or is not over
325an item, then no item has the \fBcurrent\fR tag.
326.PP
327When specifying items in canvas methods, if the
328specifier is an integer then it is assumed to refer to
329the single item with that id.
330If the specifier is not an integer, then it is assumed to
331refer to all of the items in the canvas that have a tag
332matching the specifier.
333The symbol \fItagOrId\fR is used below to indicate that
334an argument specifies either an id that selects a single
335item or a tag that selects zero or more items.
336.PP
337\&\fItagOrId\fR may contain a logical expressions of
338tags by using operators: '&&', '||', '^' '!', and parenthezised
339subexpressions. For example:
340.PP
341$c\->find('withtag', '(a&&!b)|(!a&&b)');
342.PP
343or equivalently:
344.PP
345$c\->find('withtag', 'a^b');
346.PP
347will find only those items with either \*(L"a\*(R" or \*(L"b\*(R" tags, but not both.
348.PP
349Some methods only operate on a single item at a
350time; if \fItagOrId\fR is specified in a way that
351names multiple items, then the normal behavior is for
352the methods is to use the first (lowest) of these items in
353the display list that is suitable for the method.
354Exceptions are noted in the method descriptions
355below.
356.SH "COORDINATES"
357.IX Header "COORDINATES"
358All coordinates related to canvases are stored as floating-point
359numbers.
360Coordinates and distances are specified in screen units,
361which are floating-point numbers optionally followed
362by one of several letters.
363If no letter is supplied then the distance is in pixels.
364If the letter is \fBm\fR then the distance is in millimeters on
365the screen; if it is \fBc\fR then the distance is in centimeters;
366\&\fBi\fR means inches, and \fBp\fR means printers points (1/72 inch).
367Larger y\-coordinates refer to points lower on the screen; larger
368x\-coordinates refer to points farther to the right.
369.SH "TRANSFORMATIONS"
370.IX Header "TRANSFORMATIONS"
371Normally the origin of the canvas coordinate system is at the
372upper-left corner of the window containing the canvas.
373It is possible to adjust the origin of the canvas
374coordinate system relative to the origin of the window using the
375\&\fBxview\fR and \fByview\fR methods; this is typically used
376for scrolling.
377Canvases do not support scaling or rotation of the canvas coordinate
378system relative to the window coordinate system.
379.PP
380Individual items may be moved or scaled using methods
381described below, but they may not be rotated.
382.SH "INDICES"
383.IX Header "INDICES"
384Text items support the notion of an \fIindex\fR for identifying
385particular positions within the item.
386.PP
387Indices are used for methods such as inserting text, deleting
388a range of characters, and setting the insertion cursor position.
389An index may be specified in any of a number of ways, and
390different types of items may support different forms for
391specifying indices.
392.PP
393In a similar fashion, line and polygon items support \fIindex\fR for
394identifying, inserting and deleting subsets of their coordinates.
395Indices are used for commands such as inserting or deleting
396a range of characters or coordinates, and setting the insertion
397cursor position. An index may be specified in any of a number
398of ways, and different types of items may support different forms
399for specifying indices.
400.PP
401Text items support the following forms for an index; if you
402define new types of text-like items, it would be advisable to
403support as many of these forms as practical.
404Note that it is possible to refer to the character just after
405the last one in the text item; this is necessary for such
406tasks as inserting new text at the end of the item.
407Lines and Polygons don't support the insertion cursor
408and the selection. Their indices are supposed to be even
409always, because coordinates always appear in pairs.
410.IP "\fInumber\fR" 4
411.IX Item "number"
412A decimal number giving the position of the desired character
413within the text item.
4140 refers to the first character, 1 to the next character, and
415so on. If indexes are odd for lines and polygons, they will be
416automatically decremented by one.
417A number less than 0 is treated as if it were zero, and a
418number greater than the length of the text item is treated
419as if it were equal to the length of the text item. For
420polygons, numbers less than 0 or greater then the length
421of the coordinate list will be adjusted by adding or substracting
422the length until the result is between zero and the length,
423inclusive.
424.IP "\fBend\fR" 4
425.IX Item "end"
426Refers to the character or coordinate just after the last one
427in the item (same as the number of characters or coordinates
428in the item).
429.IP "\fBinsert\fR" 4
430.IX Item "insert"
431Refers to the character just before which the insertion cursor
432is drawn in this item. Not valid for lines and polygons.
433.IP "\fBsel.first\fR" 4
434.IX Item "sel.first"
435Refers to the first selected character in the item.
436If the selection isn't in this item then this form is illegal.
437.IP "\fBsel.last\fR" 4
438.IX Item "sel.last"
439Refers to the last selected character in the item.
440If the selection isn't in this item then this form is illegal.
441.IP "\fB[\fR\fIx,y\fR\fB]\fR" 4
442.IX Item "[x,y]"
443Refers to the character or coordinate at the point given by \fIx\fR and
444\&\fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate
445system of the canvas.
446If \fIx\fR and \fIy\fR lie outside the coordinates covered by the
447text item, then they refer to the first or last character in the
448line that is closest to the given point.
449The Tcl string form \*(L"@x,y\*(R" is also allowed.
450.SH "DASH PATTERNS"
451.IX Header "DASH PATTERNS"
452Many items support the notion of an dash pattern for outlines.
453.PP
454The first possible syntax is a list of integers. Each element
455represents the number of pixels of a line segment. Only the odd
456segments are drawn using the \*(L"outline\*(R" color. The other segments
457are drawn transparant.
458.PP
459The second possible syntax is a character list containing only
4605 possible characters \fB[.,\-_ ]\fR. The space can be used
461to enlarge the space between other line elements, and can not
462occur as the first position in the string. Some examples:
463.PP
464.Vb 6
465\& -dash . = -dash [2,4]
466\& -dash - = -dash [6,4]
467\& -dash -. = -dash [6,4,2,4]
468\& -dash -.. = -dash [6,4,2,4,2,4]
469\& -dash '. ' = -dash [2,8]
470\& -dash ',' = -dash [4,4]
471.Ve
472.PP
473The main difference of this syntax with the previous is that it
474it shape\-conserving. This means that all values in the dash
475list will be multiplied by the line width before display. This
476assures that \*(L".\*(R" will always be displayed as a dot and \*(L"\-\*(R"
477always as a dash regardless of the line width.
478.PP
479On systems where only a limited set of dash patterns, the dash
480pattern will be displayed as the most close dash pattern that
481is available. For example, on Windows only the first 4 of the
482above examples are available. The last 2 examples will be
483displayed identically as the first one.
484.SH "WIDGET METHODS"
485.IX Header "WIDGET METHODS"
486The \fBCanvas\fR method creates a widget object.
487This object supports the \fBconfigure\fR and \fBcget\fR methods
488described in Tk::options which can be used to enquire and
489modify the options described above.
490The widget also inherits all the methods provided by the generic
491Tk::Widget class.
492.PP
493The following additional methods are available for canvas widgets:
494.IP "\fI$canvas\fR\->\fBaddtag\fR(\fItag, searchSpec, \fR?\fIarg, arg, ...\fR?)" 4
495.IX Item "$canvas->addtag(tag, searchSpec, ?arg, arg, ...?)"
496For each item that meets the constraints specified by
497\&\fIsearchSpec\fR and the \fIarg\fRs, add
498\&\fItag\fR to the list of tags associated with the item if it
499isn't already present on that list.
500It is possible that no items will satisfy the constraints
501given by \fIsearchSpec\fR and \fIarg\fRs, in which case the
502method has no effect.
503This command returns an empty string as result.
504\&\fISearchSpec\fR and \fIarg\fR's may take any of the following
505forms:
506.RS 4
507.IP "\fBabove \fR\fItagOrId\fR" 8
508.IX Item "above tagOrId"
509Selects the item just after (above) the one given by \fItagOrId\fR
510in the display list.
511If \fItagOrId\fR denotes more than one item, then the last (topmost)
512of these items in the display list is used.
513.IP "\fBall\fR" 8
514.IX Item "all"
515Selects all the items in the canvas.
516.IP "\fBbelow \fR\fItagOrId\fR" 8
517.IX Item "below tagOrId"
518Selects the item just before (below) the one given by \fItagOrId\fR
519in the display list.
520If \fItagOrId\fR denotes more than one item, then the first (lowest)
521of these items in the display list is used.
522.IP "\fBclosest \fR\fIx y \fR?\fIhalo\fR? ?\fIstart\fR?" 8
523.IX Item "closest x y ?halo? ?start?"
524Selects the item closest to the point given by \fIx\fR and \fIy\fR.
525If more than one item is at the same closest distance (e.g. two
526items overlap the point), then the top-most of these items (the
527last one in the display list) is used.
528If \fIhalo\fR is specified, then it must be a non-negative
529value.
530Any item closer than \fIhalo\fR to the point is considered to
531overlap it.
532The \fIstart\fR argument may be used to step circularly through
533all the closest items.
534If \fIstart\fR is specified, it names an item using a tag or id
535(if by tag, it selects the first item in the display list with
536the given tag).
537Instead of selecting the topmost closest item, this form will
538select the topmost closest item that is below \fIstart\fR in
539the display list; if no such item exists, then the selection
540behaves as if the \fIstart\fR argument had not been specified.
541.IP "\fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR" 8
542.IX Item "enclosed x1 y1 x2 y2"
543Selects all the items completely enclosed within the rectangular
544region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
545\&\fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be
546no greater than \fIy2\fR.
547.IP "\fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR" 8
548.IX Item "overlapping x1 y1 x2 y2"
549Selects all the items that overlap or are enclosed within the
550rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR,
551and \fIy2\fR.
552\&\fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be
553no greater than \fIy2\fR.
554.IP "\fBwithtag \fR\fItagOrId\fR" 8
555.IX Item "withtag tagOrId"
556Selects all the items given by \fItagOrId\fR.
557.RE
558.RS 4
559.RE
560.IP "\fI$canvas\fR\->\fBbbox\fR(\fItagOrId, \fR?\fItagOrId, tagOrId, ...\fR?)" 4
561.IX Item "$canvas->bbox(tagOrId, ?tagOrId, tagOrId, ...?)"
562Returns a list with four elements giving an approximate bounding box
563for all the items named by the \fItagOrId\fR arguments.
564The list has the form ``\fIx1 y1 x2 y2\fR'' such that the drawn
565areas of all the named elements are within the region bounded by
566\&\fIx1\fR on the left, \fIx2\fR on the right, \fIy1\fR on the top,
567and \fIy2\fR on the bottom.
568The return value may overestimate the actual bounding box by
569a few pixels.
570If no items match any of the \fItagOrId\fR arguments or if the
571matching items have empty bounding boxes (i.e. they have nothing
572to display)
573then an empty string is returned.
574.IP "\fI$canvas\fR\->\fBbind\fR(\fItagOrId\fR?, \fIsequence\fR? ?,\fIcallback\fR?)" 4
575.IX Item "$canvas->bind(tagOrId?, sequence? ?,callback?)"
576This method associates \fIcallback\fR with all the items given by
577\&\fItagOrId\fR such that whenever the event sequence given by
578\&\fIsequence\fR occurs for one of the items the callback will
579be invoked.
580This method is similar to the \fBbind\fR method except that
581it operates on items in a canvas rather than entire widgets.
582See Tk::bind for complete details
583on the syntax of \fIsequence\fR and the substitutions performed
584on \fIcallback\fR before invoking it.
585If all arguments are specified then a new binding is created, replacing
586any existing binding for the same \fIsequence\fR and \fItagOrId\fR
587(if the first character of \fIcommand\fR is ``+'' then \fIcommand\fR
588augments an existing binding rather than replacing it).
589In this case the return value is an empty string.
590If \fIcallback\fR is omitted then the method returns the \fIcallback\fR
591associated with \fItagOrId\fR and \fIsequence\fR (an error occurs
592if there is no such binding).
593If both \fIcallback\fR and \fIsequence\fR are omitted then the method
594returns a list of all the sequences for which bindings have been
595defined for \fItagOrId\fR.
596.RS 4
597.Sp
598.RS 8
599The only events for which bindings may be specified are those related to
600the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
601\&\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR) or virtual events.
602The handling of events in canvases uses the current item defined
603in \*(L"\s-1ITEM\s0 \s-1IDS\s0 \s-1AND\s0 \s-1TAGS\s0\*(R" above. \fBEnter\fR and \fBLeave\fR events trigger for an
604item when it becomes the current item or ceases to be the current item;
605note that these events are different than \fBEnter\fR and \fBLeave\fR
606events for windows. Mouse-related events are directed to the current
607item, if any. Keyboard-related events are directed to the focus item, if
608any (see the focus method below for more on this). If a
609virtual event is used in a binding, that binding can trigger only if the
610virtual event is defined by an underlying mouse-related or
611keyboard-related event.
612.Sp
613It is possible for multiple bindings to match a particular event.
614This could occur, for example, if one binding is associated with the
615item's id and another is associated with one of the item's tags.
616When this occurs, all of the matching bindings are invoked.
617A binding associated with the \fBall\fR tag is invoked first,
618followed by one binding for each of the item's tags (in order),
619followed by a binding associated with the item's id.
620If there are multiple matching bindings for a single tag,
621then only the most specific binding is invoked.
622A \fBcontinue\fR in a callback terminates that
623subroutine, and a \fBbreak\fR method terminates that subroutine
624and skips any remaining callbacks for the event, just as for the
625\&\fBbind\fR method.
626.Sp
627If bindings have been created for a canvas window using the \fBCanvasBind\fR
628method, then they are invoked in addition to bindings created for
629the canvas's items using the \fBbind\fR method.
630The bindings for items will be invoked before any of the bindings
631for the window as a whole.
632.RE
633.RE
634.RS 4
635.RE
636.IP "\fI$canvas\fR\->\fBcanvasx\fR(\fIscreenx\fR?, \fIgridspacing\fR?)" 4
637.IX Item "$canvas->canvasx(screenx?, gridspacing?)"
638Given a window x\-coordinate in the canvas \fIscreenx\fR, this method returns
639the canvas x\-coordinate that is displayed at that location.
640If \fIgridspacing\fR is specified, then the canvas coordinate is
641rounded to the nearest multiple of \fIgridspacing\fR units.
642.IP "\fI$canvas\fR\->\fBcanvasy\fR(\fIscreeny, \fR?\fIgridspacing\fR?)" 4
643.IX Item "$canvas->canvasy(screeny, ?gridspacing?)"
644Given a window y\-coordinate in the canvas \fIscreeny\fR this method returns
645the canvas y\-coordinate that is displayed at that location.
646If \fIgridspacing\fR is specified, then the canvas coordinate is
647rounded to the nearest multiple of \fIgridspacing\fR units.
648.IP "\fI$canvas\fR\->\fBcoords\fR(\fItagOrId \fR?\fIx0,y0 ...\fR?)" 4
649.IX Item "$canvas->coords(tagOrId ?x0,y0 ...?)"
650Query or modify the coordinates that define an item.
651If no coordinates are specified, this method returns a list
652whose elements are the coordinates of the item named by
653\&\fItagOrId\fR.
654If coordinates are specified, then they replace the current
655coordinates for the named item.
656If \fItagOrId\fR refers to multiple items, then
657the first one in the display list is used.
658.IP "\fI$canvas\fR\->\fBcreate\fR(\fItype, x, y, \fR?\fIx, y, ...\fR?, ?\fIoption, value, ...\fR?)" 4
659.IX Item "$canvas->create(type, x, y, ?x, y, ...?, ?option, value, ...?)"
660Create a new item in \fI$canvas\fR of type \fItype\fR.
661The exact format of the arguments after \fBtype\fR depends
662on \fBtype\fR, but usually they consist of the coordinates for
663one or more points, followed by specifications for zero or
664more item options.
665See the subsections on individual item types below for more
666on the syntax of this method.
667This method returns the id for the new item.
668.IP "\fI$canvas\fR\->\fBdchars\fR(\fItagOrId, first, \fR?\fIlast\fR?)" 4
669.IX Item "$canvas->dchars(tagOrId, first, ?last?)"
670For each item given by \fItagOrId\fR, delete the characters, or coordinates,
671in the range given by \fIfirst\fR and \fIlast\fR, inclusive.
672If some of the items given by \fItagOrId\fR don't support
673Text items interpret \fIfirst\fR and \fIlast\fR as indices to a character,
674line and polygon items interpret them indices to a coordinate (an x,y pair).
675within the item(s) as described in \*(L"\s-1INDICES\s0\*(R" above.
676If \fIlast\fR is omitted, it defaults to \fIfirst\fR.
677This method returns an empty string.
678.IP "\fI$canvas\fR\->\fBdelete\fR(?\fItagOrId, tagOrId, ...\fR?)" 4
679.IX Item "$canvas->delete(?tagOrId, tagOrId, ...?)"
680Delete each of the items given by each \fItagOrId\fR, and return
681an empty string.
682.IP "\fI$canvas\fR\->\fBdtag\fR(\fItagOrId, \fR?\fItagToDelete\fR?)" 4
683.IX Item "$canvas->dtag(tagOrId, ?tagToDelete?)"
684For each of the items given by \fItagOrId\fR, delete the
685tag given by \fItagToDelete\fR from the list of those
686associated with the item.
687If an item doesn't have the tag \fItagToDelete\fR then
688the item is unaffected by the method.
689If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR.
690This method returns an empty string.
691.IP "\fI$canvas\fR\->\fBfind\fR(\fIsearchCommand, \fR?\fIarg, arg, ...\fR?)" 4
692.IX Item "$canvas->find(searchCommand, ?arg, arg, ...?)"
693This method returns a list consisting of all the items that
694meet the constraints specified by \fIsearchCommand\fR and
695\&\fIarg\fR's.
696\&\fISearchCommand\fR and \fIargs\fR have any of the forms
697accepted by the \fBaddtag\fR method.
698The items are returned in stacking order, with the lowest item first.
699.IP "focus" 4
700.IX Item "focus"
701.PD 0
702.IP "\fI$canvas\fR\->\fBfocus\fR(?\fItagOrId\fR?)" 4
703.IX Item "$canvas->focus(?tagOrId?)"
704.PD
705Set the keyboard focus for the canvas widget to the item given by
706\&\fItagOrId\fR.
707If \fItagOrId\fR refers to several items, then the focus is set
708to the first such item in the display list that supports the
709insertion cursor.
710If \fItagOrId\fR doesn't refer to any items, or if none of them
711support the insertion cursor, then the focus isn't changed.
712If \fItagOrId\fR is an empty
713string, then the focus item is reset so that no item has the focus.
714If \fItagOrId\fR is not specified then the method returns the
715id for the item that currently has the focus, or an empty string
716if no item has the focus.
717.RS 4
718.Sp
719.RS 8
720Once the focus has been set to an item, the item will display
721the insertion cursor and all keyboard events will be directed
722to that item.
723The focus item within a canvas and the focus window on the
724screen (set with the \fBfocus\fR method) are totally independent:
725a given item doesn't actually have the input focus unless (a)
726its canvas is the focus window and (b) the item is the focus item
727within the canvas.
728In most cases it is advisable to follow the \fBfocus\fR widget
729method with the \fBCanvasFocus\fR method to set the focus window to
730the canvas (if it wasn't there already).
731.RE
732.RE
733.RS 4
734.RE
735.IP "\fI$canvas\fR\->\fBgettags\fR(\fItagOrId\fR)" 4
736.IX Item "$canvas->gettags(tagOrId)"
737Return a list whose elements are the tags associated with the
738item given by \fItagOrId\fR.
739If \fItagOrId\fR refers to more than one item, then the tags
740are returned from the first such item in the display list.
741If \fItagOrId\fR doesn't refer to any items, or if the item
742contains no tags, then an empty string is returned.
743.IP "\fI$canvas\fR\->\fBicursor\fR(\fItagOrId, index\fR)" 4
744.IX Item "$canvas->icursor(tagOrId, index)"
745Set the position of the insertion cursor for the item(s) given by \fItagOrId\fR
746to just before the character whose position is given by \fIindex\fR.
747If some or all of the items given by \fItagOrId\fR don't support
748an insertion cursor then this method has no effect on them.
749See \*(L"\s-1INDICES\s0\*(R" above for a description of the
750legal forms for \fIindex\fR.
751Note: the insertion cursor is only displayed in an item if
752that item currently has the keyboard focus (see the widget
753method \fBfocus\fR, below), but the cursor position may
754be set even when the item doesn't have the focus.
755This method returns an empty string.
756.IP "\fI$canvas\fR\->\fBindex\fR(\fItagOrId, index\fR)" 4
757.IX Item "$canvas->index(tagOrId, index)"
758This method returns a decimal string giving the numerical index
759within \fItagOrId\fR corresponding to \fIindex\fR.
760\&\fIIndex\fR gives a textual description of the desired position
761as described in \*(L"\s-1INDICES\s0\*(R" above.
762Text items interpret \fIindex\fR as an index to a character,
763line and polygon items interpret it as an index to a coordinate (an x,y pair).
764The return value is guaranteed to lie between 0 and the number
765of characters, or coordinates, within the item, inclusive.
766If \fItagOrId\fR refers to multiple items, then the index
767is processed in the first of these items that supports indexing
768operations (in display list order).
769.IP "\fI$canvas\fR\->\fBinsert\fR(\fItagOrId, beforeThis, string\fR)" 4
770.IX Item "$canvas->insert(tagOrId, beforeThis, string)"
771For each of the items given by \fItagOrId\fR, if the item supports
772text or coordinate, insertion then \fIstring\fR is inserted into the item's
773text just before the character, or coordinate, whose index is \fIbeforeThis\fR.
774Text items interpret \fIbeforethis\fR as an index to a character,
775line and polygon items interpret it as an index to a coordinate (an x,y pair).
776For lines and polygons the \fIstring\fR must be a valid coordinate
777sequence.
778See \*(L"\s-1INDICES\s0\*(R" above for information about the forms allowed
779for \fIbeforeThis\fR.
780This method returns an empty string.
781.IP "\fI$canvas\fR\->\fBitemcget\fR(\fItagOrId, \fR\fIoption\fR)" 4
782.IX Item "$canvas->itemcget(tagOrId, option)"
783Returns the current value of the configuration option for the
784item given by \fItagOrId\fR whose name is \fIoption\fR.
785This method is similar to the cget method except that
786it applies to a particular item rather than the widget as a whole.
787\&\fIOption\fR may have any of the values accepted by the \fBcreate\fR
788method when the item was created.
789If \fItagOrId\fR is a tag that refers to more than one item,
790the first (lowest) such item is used.
791.IP "\fI$canvas\fR\->\fBitemconfigure\fR(\fItagOrId, \fR?\fIoption\fR?, ?\fIvalue\fR?, ?\fIoption, value, ...\fR?)" 4
792.IX Item "$canvas->itemconfigure(tagOrId, ?option?, ?value?, ?option, value, ...?)"
793This method is similar to the configure method except
794that it modifies item-specific options for the items given by
795\&\fItagOrId\fR instead of modifying options for the overall
796canvas widget.
797If no \fIoption\fR is specified, returns a list describing all of
798the available options for the first item given by \fItagOrId\fR
799(see Tk::options for
800information on the format of this list). If \fIoption\fR is specified
801with no \fIvalue\fR, then the method returns a list describing the
802one named option (this list will be identical to the corresponding
803sublist of the value returned if no \fIoption\fR is specified). If
804one or more \fIoption-value\fR pairs are specified, then the method
805modifies the given widget option(s) to have the given value(s) in
806each of the items given by \fItagOrId\fR; in
807this case the method returns an empty string.
808The \fIoption\fRs and \fIvalue\fRs are the same as those permissible
809in the \fBcreate\fR method when the item(s) were created;
810see the sections describing individual item types below for details
811on the legal options.
812.IP "\fI$canvas\fR\->\fBlower\fR(\fItagOrId, \fR?\fIbelowThis\fR?)" 4
813.IX Item "$canvas->lower(tagOrId, ?belowThis?)"
814Move all of the items given by \fItagOrId\fR to a new position
815in the display list just before the item given by \fIbelowThis\fR.
816If \fItagOrId\fR refers to more than one item then all are moved
817but the relative order of the moved items will not be changed.
818\&\fIBelowThis\fR is a tag or id; if it refers to more than one
819item then the first (lowest) of these items in the display list is used
820as the destination location for the moved items.
821Note: this method has no effect on window items. Window items always
822obscure other item types, and the stacking order of window items is
823determined by the \fBraise\fR and \fBlower\fR methods of the widget, not the
824\&\fBraise\fR and \fBlower\fR methods for canvases.
825This method returns an empty string.
826.IP "\fI$canvas\fR\->\fBmove\fR(\fItagOrId, xAmount, yAmount\fR)" 4
827.IX Item "$canvas->move(tagOrId, xAmount, yAmount)"
828Move each of the items given by \fItagOrId\fR in the canvas coordinate
829space by adding \fIxAmount\fR to the x\-coordinate of each point
830associated with the item and \fIyAmount\fR to the y\-coordinate of
831each point associated with the item.
832This method returns an empty string.
833.IP "\fI$canvas\fR\->\fBpostscript\fR(?\fIoption, value, option, value, ...\fR?)" 4
834.IX Item "$canvas->postscript(?option, value, option, value, ...?)"
835Generate a Postscript representation for part or all of the canvas.
836If the \fB\-file\fR option is specified then the Postscript is written
837to a file and an empty string is returned; otherwise the Postscript
838is returned as the result of the method.
839If the interpreter that owns the canvas is marked as safe, the operation
840will fail because safe interpreters are not allowed to write files.
841If the \fB\-channel\fR option is specified, the argument denotes the name
842of a channel already opened for writing. The Postscript is written to
843that channel, and the channel is left open for further writing at the end
844of the operation.
845The Postscript is created in Encapsulated Postscript form using
846version 3.0 of the Document Structuring Conventions.
847Note: by default Postscript is only generated for information that
848appears in the canvas's window on the screen. If the canvas is
849freshly created it may still have its initial size of 1x1 pixel
850so nothing will appear in the Postscript. To get around this problem
851either invoke the \fBupdate\fR method to wait for the canvas window
852to reach its final size, or else use the \fB\-width\fR and \fB\-height\fR
853options to specify the area of the canvas to print.
854The \fIoption\fR\-\fIvalue\fR argument pairs provide additional
855information to control the generation of Postscript. The following
856options are supported:
857.RS 4
858.IP "\fB\-colormap\fR => \fIhashRef\fR" 8
859.IX Item "-colormap => hashRef"
860\&\fIHashRef\fR must be a reference to a hash variable or an anonymous hash
861that specifies a color mapping to use in the Postscript.
862Each value of the hash must consist of Postscript
863code to set a particular color value (e.g. ``\fB1.0 1.0 0.0 setrgbcolor\fR'').
864When outputting color information in the Postscript, Tk checks
865to see if there is a key in the hash with the same
866name as the color.
867If so, Tk uses the value of the element as the Postscript method
868to set the color.
869If this option hasn't been specified, or if there isn't a key
870in \fIhashRef\fR for a given color, then Tk uses the red, green,
871and blue intensities from the X color.
872.IP "\fB\-colormode\fR => \fImode\fR" 8
873.IX Item "-colormode => mode"
874Specifies how to output color information. \fIMode\fR must be either
875\&\fBcolor\fR (for full color output), \fBgray\fR (convert all colors
876to their gray-scale equivalents) or \fBmono\fR (convert all colors
877to black or white).
878.IP "\fB\-file\fR => \fIfileName\fR" 8
879.IX Item "-file => fileName"
880Specifies the name of the file in which to write the Postscript.
881If this option isn't specified then the Postscript is returned as the
882result of the method instead of being written to a file.
883.IP "\fB\-fontmap\fR => \fIhashRef\fR" 8
884.IX Item "-fontmap => hashRef"
885\&\fIHashRef\fR must be a reference to a hash variable or an anonymous hash
886that specifies a font mapping to use in the Postscript.
887Each value of the hash must consist of an array reference with
888two elements, which are the name and point size of a Postscript font.
889When outputting Postscript commands for a particular font, Tk
890checks to see if \fIhashRef\fR contains a value with the same
891name as the font.
892If there is such an element, then the font information contained in
893that element is used in the Postscript.
894Otherwise Tk attempts to guess what Postscript font to use.
895Tk's guesses generally only work for well-known fonts such as
896Times and Helvetica and Courier, and only if the X font name does not
897omit any dashes up through the point size.
898For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but
899\&\fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to
900parse the font name).
901.IP "\fB\-height\fR => \fIsize\fR" 8
902.IX Item "-height => size"
903Specifies the height of the area of the canvas to print.
904Defaults to the height of the canvas window.
905.IP "\fB\-pageanchor\fR => \fIanchor\fR" 8
906.IX Item "-pageanchor => anchor"
907Specifies which point of the printed area of the canvas should appear over
908the positioning point on the page (which is given by the \fB\-pagex\fR
909and \fB\-pagey\fR options).
910For example, \fB\-pageanchor\fR=>\fBn\fR means that the top center of the
911area of the canvas being printed (as it appears in the canvas window)
912should be over the positioning point. Defaults to \fBcenter\fR.
913.IP "\fB\-pageheight\fR => \fIsize\fR" 8
914.IX Item "-pageheight => size"
915Specifies that the Postscript should be scaled in both x and y so
916that the printed area is \fIsize\fR high on the Postscript page.
917\&\fISize\fR consists of a floating-point number followed by
918\&\fBc\fR for centimeters, \fBi\fR for inches, \fBm\fR for millimeters,
919or \fBp\fR or nothing for printer's points (1/72 inch).
920Defaults to the height of the printed area on the screen.
921If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
922the scale factor from \fB\-pagewidth\fR is used (non\-uniform scaling
923is not implemented).
924.IP "\fB\-pagewidth\fR => \fIsize\fR" 8
925.IX Item "-pagewidth => size"
926Specifies that the Postscript should be scaled in both x and y so
927that the printed area is \fIsize\fR wide on the Postscript page.
928\&\fISize\fR has the same form as for \fB\-pageheight\fR.
929Defaults to the width of the printed area on the screen.
930If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
931the scale factor from \fB\-pagewidth\fR is used (non\-uniform scaling
932is not implemented).
933.IP "\fB\-pagex\fR => \fIposition\fR" 8
934.IX Item "-pagex => position"
935\&\fIPosition\fR gives the x\-coordinate of the positioning point on
936the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
937Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options
938to determine where the printed area appears on the Postscript page.
939Defaults to the center of the page.
940.IP "\fB\-pagey\fR => \fIposition\fR" 8
941.IX Item "-pagey => position"
942\&\fIPosition\fR gives the y\-coordinate of the positioning point on
943the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
944Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options
945to determine where the printed area appears on the Postscript page.
946Defaults to the center of the page.
947.IP "\fB\-rotate\fR => \fIboolean\fR" 8
948.IX Item "-rotate => boolean"
949\&\fIBoolean\fR specifies whether the printed area is to be rotated 90
950degrees.
951In non-rotated output the x\-axis of the printed area runs along
952the short dimension of the page (``portrait'' orientation);
953in rotated output the x\-axis runs along the long dimension of the
954page (``landscape'' orientation).
955Defaults to non\-rotated.
956.IP "\fB\-width\fR => \fIsize\fR" 8
957.IX Item "-width => size"
958Specifies the width of the area of the canvas to print.
959Defaults to the width of the canvas window.
960.IP "\fB\-x\fR => \fIposition\fR" 8
961.IX Item "-x => position"
962Specifies the x\-coordinate of the left edge of the area of the
963canvas that is to be printed, in canvas coordinates, not window
964coordinates.
965Defaults to the coordinate of the left edge of the window.
966.IP "\fB\-y\fR => \fIposition\fR" 8
967.IX Item "-y => position"
968Specifies the y\-coordinate of the top edge of the area of the
969canvas that is to be printed, in canvas coordinates, not window
970coordinates.
971Defaults to the coordinate of the top edge of the window.
972.RE
973.RS 4
974.RE
975.IP "\fI$canvas\fR\->\fBraise\fR(\fItagOrId, \fR?\fIaboveThis\fR?)" 4
976.IX Item "$canvas->raise(tagOrId, ?aboveThis?)"
977Move all of the items given by \fItagOrId\fR to a new position
978in the display list just after the item given by \fIaboveThis\fR.
979If \fItagOrId\fR refers to more than one item then all are moved
980but the relative order of the moved items will not be changed.
981\&\fIAboveThis\fR is a tag or id; if it refers to more than one
982item then the last (topmost) of these items in the display list is used
983as the destination location for the moved items.
984Note: this method has no effect on window items. Window items always
985obscure other item types, and the stacking order of window items is
986determined by the \fBraise\fR and \fBlower\fR widget commands, not the
987\&\fBraise\fR and \fBlower\fR methods for canvases.
988This method returns an empty string.
989.IP "\fI$canvas\fR\->\fBscale\fR(\fItagOrId, xOrigin, yOrigin, xScale, yScale\fR)" 4
990.IX Item "$canvas->scale(tagOrId, xOrigin, yOrigin, xScale, yScale)"
991Rescale all of the items given by \fItagOrId\fR in canvas coordinate
992space.
993\&\fIXOrigin\fR and \fIyOrigin\fR identify the origin for the scaling
994operation and \fIxScale\fR and \fIyScale\fR identify the scale
995factors for x\- and y\-coordinates, respectively (a scale factor of
9961.0 implies no change to that coordinate).
997For each of the points defining each item, the x\-coordinate is
998adjusted to change the distance from \fIxOrigin\fR by a factor
999of \fIxScale\fR.
1000Similarly, each y\-coordinate is adjusted to change the distance
1001from \fIyOrigin\fR by a factor of \fIyScale\fR.
1002This method returns an empty string.
1003.IP "\fI$canvas\fR\->\fBscan\fR(\fIoption, args\fR)" 4
1004.IX Item "$canvas->scan(option, args)"
1005This method is used to implement scanning on canvases. It has
1006two forms, depending on \fIoption\fR:
1007.RS 4
1008.IP "\fI$canvas\fR\->\fBscanMark\fR(\fIx, y\fR)" 8
1009.IX Item "$canvas->scanMark(x, y)"
1010Records \fIx\fR and \fIy\fR and the canvas's current view; used
1011in conjunction with later \fBscanDragto\fR method.
1012Typically this method is associated with a mouse button press in
1013the widget and \fIx\fR and \fIy\fR are the coordinates of the
1014mouse. It returns an empty string.
1015.IP "\fI$canvas\fR\->\fBscanDragto\fR(\fIx, y, ?gain?\fR.)" 8
1016.IX Item "$canvas->scanDragto(x, y, ?gain?.)"
1017This method computes the difference between its \fIx\fR and \fIy\fR
1018arguments (which are typically mouse coordinates) and the \fIx\fR and
1019\&\fIy\fR arguments to the last \fBscanMark\fR method for the widget.
1020It then adjusts the view by 10 times the
1021difference in coordinates. This method is typically associated
1022It then adjusts the view by \fIgain\fR times the
1023difference in coordinates, where \fIgain\fR defaults to 10.
1024This command is typically associated
1025with mouse motion events in the widget, to produce the effect of
1026dragging the canvas at high speed through its window. The return
1027value is an empty string.
1028.RE
1029.RS 4
1030.RE
1031.IP "\fI$canvas\fR\->\fBselect\fR(\fIoption, \fR?\fItagOrId, arg\fR?)" 4
1032.IX Item "$canvas->select(option, ?tagOrId, arg?)"
1033Manipulates the selection in one of several ways, depending on
1034\&\fIoption\fR.
1035The method may take any of the forms described below.
1036In all of the descriptions below, \fItagOrId\fR must refer to
1037an item that supports indexing and selection; if it refers to
1038multiple items then the first of
1039these that supports indexing and the selection is used.
1040\&\fIIndex\fR gives a textual description of a position
1041within \fItagOrId\fR, as described in \*(L"\s-1INDICES\s0\*(R" above.
1042.RS 4
1043.IP "\fI$canvas\fR\->\fBselectAdjust\fR(\fItagOrId, index\fR)" 8
1044.IX Item "$canvas->selectAdjust(tagOrId, index)"
1045Locate the end of the selection in \fItagOrId\fR nearest
1046to the character given by \fIindex\fR, and adjust that
1047end of the selection to be at \fIindex\fR (i.e. including
1048but not going beyond \fIindex\fR).
1049The other end of the selection is made the anchor point
1050for future \fBselectTo\fR method calls.
1051If the selection isn't currently in \fItagOrId\fR then
1052this method behaves the same as the \fBselectTo\fR widget
1053method.
1054Returns an empty string.
1055.IP "\fI$canvas\fR\->\fBselectClear\fR" 8
1056.IX Item "$canvas->selectClear"
1057Clear the selection if it is in this widget.
1058If the selection isn't in this widget then the method
1059has no effect.
1060Returns an empty string.
1061.IP "\fI$canvas\fR\->\fBselectFrom\fR(\fItagOrId, index\fR)" 8
1062.IX Item "$canvas->selectFrom(tagOrId, index)"
1063Set the selection anchor point for the widget to be just
1064before the character
1065given by \fIindex\fR in the item given by \fItagOrId\fR.
1066This method doesn't change the selection; it just sets
1067the fixed end of the selection for future \fBselectTo\fR
1068method calls.
1069Returns an empty string.
1070.IP "\fI$canvas\fR\->\fBselectItem\fR" 8
1071.IX Item "$canvas->selectItem"
1072Returns the id of the selected item, if the selection is in an
1073item in this canvas.
1074If the selection is not in this canvas then an empty string
1075is returned.
1076.IP "\fI$canvas\fR\->\fBselectTo\fR(\fItagOrId, index\fR)" 8
1077.IX Item "$canvas->selectTo(tagOrId, index)"
1078Set the selection to consist of those characters of \fItagOrId\fR
1079between the selection anchor point and
1080\&\fIindex\fR.
1081The new selection will include the character given by \fIindex\fR;
1082it will include the character given by the anchor point only if
1083\&\fIindex\fR is greater than or equal to the anchor point.
1084The anchor point is determined by the most recent \fBselectAdjust\fR
1085or \fBselectFrom\fR method calls for this widget.
1086If the selection anchor point for the widget isn't currently in
1087\&\fItagOrId\fR, then it is set to the same character given
1088by \fIindex\fR.
1089Returns an empty string.
1090.RE
1091.RS 4
1092.RE
1093.IP "\fI$canvas\fR\->\fBtype\fR(\fItagOrId\fR)" 4
1094.IX Item "$canvas->type(tagOrId)"
1095Returns the type of the item given by \fItagOrId\fR, such as
1096\&\fBrectangle\fR or \fBtext\fR.
1097If \fItagOrId\fR refers to more than one item, then the type
1098of the first item in the display list is returned.
1099If \fItagOrId\fR doesn't refer to any items at all then
1100an empty string is returned.
1101.IP "\fI$canvas\fR\->\fBxview\fR(?\fIargs\fR?)" 4
1102.IX Item "$canvas->xview(?args?)"
1103This method is used to query and change the horizontal position of the
1104information displayed in the canvas's window.
1105It can take any of the following forms:
1106.RS 4
1107.IP "\fI$canvas\fR\->\fBxview\fR" 8
1108.IX Item "$canvas->xview"
1109Returns a list containing two elements.
1110Each element is a real fraction between 0 and 1; together they describe
1111the horizontal span that is visible in the window.
1112For example, if the first element is .2 and the second element is .6,
111320% of the canvas's area (as defined by the \fB\-scrollregion\fR option)
1114is off-screen to the left, the middle 40% is visible
1115in the window, and 40% of the canvas is off-screen to the right.
1116These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
1117option.
1118.IP "\fI$canvas\fR\->\fBxviewMoveto\fR(\fIfraction\fR)" 8
1119.IX Item "$canvas->xviewMoveto(fraction)"
1120Adjusts the view in the window so that \fIfraction\fR of the
1121total width of the canvas is off-screen to the left.
1122\&\fIFraction\fR must be a fraction between 0 and 1.
1123.IP "\fI$canvas\fR\->\fBxviewScroll\fR(\fInumber, what\fR)" 8
1124.IX Item "$canvas->xviewScroll(number, what)"
1125This method shifts the view in the window left or right according to
1126\&\fInumber\fR and \fIwhat\fR.
1127\&\fINumber\fR must be an integer.
1128\&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
1129of one of these.
1130If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units
1131of the \fBxScrollIncrement\fR option, if it is greater than zero,
1132or in units of one-tenth the window's width otherwise.
1133If \fIwhat is \fR\fBpages\fR then the view
1134adjusts in units of nine-tenths the window's width.
1135If \fInumber\fR is negative then information farther to the left
1136becomes visible; if it is positive then information farther to the right
1137becomes visible.
1138.RE
1139.RS 4
1140.RE
1141.IP "\fI$canvas\fR\->\fByview\fR(\fI?args\fR?)" 4
1142.IX Item "$canvas->yview(?args?)"
1143This method is used to query and change the vertical position of the
1144information displayed in the canvas's window.
1145It can take any of the following forms:
1146.RS 4
1147.IP "\fI$canvas\fR\->\fByview\fR" 8
1148.IX Item "$canvas->yview"
1149Returns a list containing two elements.
1150Each element is a real fraction between 0 and 1; together they describe
1151the vertical span that is visible in the window.
1152For example, if the first element is .6 and the second element is 1.0,
1153the lowest 40% of the canvas's area (as defined by the \fB\-scrollregion\fR
1154option) is visible in the window.
1155These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
1156option.
1157.IP "\fI$canvas\fR\->\fByviewMoveto\fR(\fIfraction\fR)" 8
1158.IX Item "$canvas->yviewMoveto(fraction)"
1159Adjusts the view in the window so that \fIfraction\fR of the canvas's
1160area is off-screen to the top.
1161\&\fIFraction\fR is a fraction between 0 and 1.
1162.IP "\fI$canvas\fR\->\fByviewScroll\fR(\fInumber, what\fR)" 8
1163.IX Item "$canvas->yviewScroll(number, what)"
1164This method adjusts the view in the window up or down according to
1165\&\fInumber\fR and \fIwhat\fR.
1166\&\fINumber\fR must be an integer.
1167\&\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
1168If \fIwhat\fR is \fBunits\fR, the view adjusts up or down in units
1169of the \fByScrollIncrement\fR option, if it is greater than zero,
1170or in units of one-tenth the window's height otherwise.
1171If \fIwhat\fR is \fBpages\fR then
1172the view adjusts in units of nine-tenths the window's height.
1173If \fInumber\fR is negative then higher information becomes
1174visible; if it is positive then lower information
1175becomes visible.
1176.RE
1177.RS 4
1178.RE
1179.SH "OVERVIEW OF ITEM TYPES"
1180.IX Header "OVERVIEW OF ITEM TYPES"
1181The sections below describe the various types of items supported
1182by canvas widgets. Each item type is characterized by two things:
1183first, the form of the \fBcreate\fR method used to create
1184instances of the type; and second, a set of configuration options
1185for items of that type, which may be used in the
1186\&\fBcreate\fR and \fBitemconfigure\fR methods.
1187Most items don't support indexing or selection or the methods
1188related to them, such as \fBindex\fR and \fBinsert\fR.
1189Where items do support these facilities, it is noted explicitly
1190in the descriptions below.
1191At present, text, line and polygon items provide this support.
1192For lines and polygons the indexing facility is used to manipulate
1193the coordinates of the item.
1194.SH "ARC ITEMS"
1195.IX Header "ARC ITEMS"
1196Items of type \fBarc\fR appear on the display as arc-shaped regions.
1197An arc is a section of an oval delimited by two angles (specified
1198by the \fB\-start\fR and \fB\-extent\fR options) and displayed in
1199one of several ways (specified by the \fB\-style\fR option).
1200Arcs are created with methods of the following form:
1201.PP
1202.Vb 1
1203\& $canvas->createArc(x1, y1, x2, y2, ?option, value, option, value, ...?)
1204.Ve
1205.PP
1206The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
1207the coordinates of two diagonally opposite corners of a
1208rectangular region enclosing the oval that defines the arc.
1209After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1210pairs, each of which sets one of the configuration options
1211for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1212used in \fBitemconfigure\fR methods to change the item's
1213configuration.
1214The following options are supported for arcs:
1215.IP "\fB\-dash\fR => \fIpattern\fR" 4
1216.IX Item "-dash => pattern"
1217.PD 0
1218.IP "\fB\-activedash\fR => \fIpattern\fR" 4
1219.IX Item "-activedash => pattern"
1220.IP "\fB\-disableddash\fR => \fIpattern\fR" 4
1221.IX Item "-disableddash => pattern"
1222.PD
1223This option specifies dash patterns for the normal state, the active
1224state, and the disabled state of an arc item.
1225\&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
1226If the dash options are omitted then the default is a solid outline.
1227.IP "\fB\-dashoffset\fR => \fIoffset\fR" 4
1228.IX Item "-dashoffset => offset"
1229The starting \fIoffset\fR into the pattern provided by the
1230\&\fB\-dash\fR option.
1231\&\fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern.
1232.IP "\fB\-extent\fR => \fIdegrees\fR" 4
1233.IX Item "-extent => degrees"
1234Specifies the size of the angular range occupied by the arc.
1235The arc's range extends for \fIdegrees\fR degrees counter-clockwise
1236from the starting angle given by the \fB\-start\fR option.
1237\&\fIDegrees\fR may be negative.
1238If it is greater than 360 or less than \-360, then \fIdegrees\fR
1239modulo 360 is used as the extent.
1240.IP "\fB\-fill\fR => \fIcolor\fR" 4
1241.IX Item "-fill => color"
1242.PD 0
1243.IP "\fB\-activefill\fR => \fIcolor\fR" 4
1244.IX Item "-activefill => color"
1245.IP "\fB\-disabledfill\fR => \fIcolor\fR" 4
1246.IX Item "-disabledfill => color"
1247.PD
1248Specifies the color to be used to fill the arc region in its normal, active, and
1249disabled states,
1250\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1251If \fIcolor\fR is an empty string (the default), then
1252then the arc will not be filled.
1253.IP "\fB\-outline\fR => \fIcolor\fR" 4
1254.IX Item "-outline => color"
1255.PD 0
1256.IP "\fB\-activeoutline\fR => \fIcolor\fR" 4
1257.IX Item "-activeoutline => color"
1258.IP "\fB\-disabledoutline\fR => \fIcolor\fR" 4
1259.IX Item "-disabledoutline => color"
1260.PD
1261This option specifies the color that should be used to draw the
1262outline of the arc in its normal, active and disabled states.
1263\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1264This option defaults to \fBblack\fR. If \fIcolor\fR is specified
1265as undef then no outline is drawn for the arc.
1266.IP "\fB\-outlinestipple\fR => \fIbitmap\fR" 4
1267.IX Item "-outlinestipple => bitmap"
1268.PD 0
1269.IP "\fB\-activeoutlinestipple\fR => \fIbitmap\fR" 4
1270.IX Item "-activeoutlinestipple => bitmap"
1271.IP "\fB\-disabledoutlinestipple\fR => \fIbitmap\fR" 4
1272.IX Item "-disabledoutlinestipple => bitmap"
1273.PD
1274This option specifies stipple patterns that should be used to draw the
1275outline of the arc in its normal, active and disabled states.
1276Indicates that the outline for the arc should be drawn with a stipple pattern;
1277\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1278forms accepted by \fBTk_GetBitmap\fR.
1279If the \fB\-outline\fR option hasn't been specified then this option
1280has no effect.
1281If \fIbitmap\fR is an empty string (the default), then the outline is drawn
1282in a solid fashion.
1283.IP "\fB\-start\fR => \fIdegrees\fR" 4
1284.IX Item "-start => degrees"
1285Specifies the beginning of the angular range occupied by the
1286arc.
1287\&\fIDegrees\fR is given in units of degrees measured counter-clockwise
1288from the 3\-o'clock position; it may be either positive or negative.
1289.IP "\fB\-state\fR => \fIstate\fR" 4
1290.IX Item "-state => state"
1291Modifies the state of the arc item where \fIstate\fR may be set to one of:
1292normal, disabled, hidden or "\*(L". If set to empty, the state of the canvas
1293itself is used. An arc item may also be in the \*(R"active"
1294state if the mouse is currently over it. Many options can take
1295separate specifications in normal, active and disabled states such that the
1296appearance of the item can be different in each state.
1297.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
1298.IX Item "-stipple => bitmap"
1299.PD 0
1300.IP "\fB\-activestipple\fR => \fIbitmap\fR" 4
1301.IX Item "-activestipple => bitmap"
1302.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
1303.IX Item "-disabledstipple => bitmap"
1304.PD
1305This option specifies stipple patterns that should be used to fill the
1306the arc in its normal, active and disabled states.
1307\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1308forms accepted by \fBTk_GetBitmap\fR.
1309If the \fB\-fill\fR option hasn't been specified then this option
1310has no effect.
1311If \fIbitmap\fR is an empty string (the default), then filling is done
1312in a solid fashion.
1313.IP "\fB\-style\fR => \fItype\fR" 4
1314.IX Item "-style => type"
1315Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR
1316(the default) then the arc's region is defined by a section
1317of the oval's perimeter plus two line segments, one between the center
1318of the oval and each end of the perimeter section.
1319If \fItype\fR is \fBchord\fR then the arc's region is defined
1320by a section of the oval's perimeter plus a single line segment
1321connecting the two end points of the perimeter section.
1322If \fItype\fR is \fBarc\fR then the arc's region consists of
1323a section of the perimeter alone.
1324In this last case the \fB\-fill\fR option is ignored.
1325.IP "\fB\-tags\fR => \fItagList\fR" 4
1326.IX Item "-tags => tagList"
1327Specifies a set of tags to apply to the item.
1328\&\fITagList\fR consists of a list of tag names, which replace any
1329existing tags for the item.
1330\&\fITagList\fR may be an empty list.
1331.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
1332.IX Item "-updatecommand => command"
1333Specifies a callback that is to be executed every time
1334the arc item is updated on the screen.
1335.IP "\fB\-width\fR => \fIoutlineWidth\fR" 4
1336.IX Item "-width => outlineWidth"
1337.PD 0
1338.IP "\fB\-activewidth\fR => \fIoutlineWidth\fR" 4
1339.IX Item "-activewidth => outlineWidth"
1340.IP "\fB\-disabledwidth\fR => \fIoutlineWidth\fR" 4
1341.IX Item "-disabledwidth => outlineWidth"
1342.PD
1343Specifies the width of the outline to be drawn around
1344the arc's region, in its normal, active and disabled states.
1345\&\fIoutlineWidth\fR may be in any of the forms described in
1346the \*(L"\s-1COORDINATES\s0\*(R" section above.
1347If the \fB\-outline\fR option has been specified as undef
1348then this option has no effect.
1349Wide outlines will be drawn centered on the edges of the arc's region.
1350This option defaults to 1.0.
1351.SH "BITMAP ITEMS"
1352.IX Header "BITMAP ITEMS"
1353Items of type \fBbitmap\fR appear on the display as images with
1354two colors, foreground and background.
1355Bitmaps are created with methods of the following form:
1356.PP
1357.Vb 1
1358\& $canvas->createBitmap(x, y, ?option, value, option, value, ...?)
1359.Ve
1360.PP
1361The arguments \fIx\fR and \fIy\fR specify the coordinates of a
1362point used to position the bitmap on the display (see the \fB\-anchor\fR
1363option below for more information on how bitmaps are displayed).
1364After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1365pairs, each of which sets one of the configuration options
1366for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1367used in \fBitemconfigure\fR methods to change the item's
1368configuration.
1369The following options are supported for bitmaps:
1370.IP "\fB\-anchor\fR => \fIanchorPos\fR" 4
1371.IX Item "-anchor => anchorPos"
1372\&\fIAnchorPos\fR tells how to position the bitmap relative to the
1373positioning point for the item; it may have any of the forms
1374accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
1375is \fBcenter\fR then the bitmap is centered on the point; if
1376\&\fIanchorPos\fR is \fBn\fR then the bitmap will be drawn so that
1377its top center point is at the positioning point.
1378This option defaults to \fBcenter\fR.
1379.IP "\fB\-background\fR => \fIcolor\fR" 4
1380.IX Item "-background => color"
1381.PD 0
1382.IP "\fB\-activebackground\fR => \fIcolor\fR" 4
1383.IX Item "-activebackground => color"
1384.IP "\fB\-disabledbackground\fR => \fIcolor\fR" 4
1385.IX Item "-disabledbackground => color"
1386.PD
1387Specifies the color to use for each of the bitmap's '0' valued pixels
1388in its normal, active and disabled states.
1389\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1390If this option isn't specified, or if it is specified as undef,
1391then nothing is displayed where the bitmap pixels are 0; this
1392produces a transparent effect.
1393.IP "\fB\-bitmap\fR => \fIbitmap\fR" 4
1394.IX Item "-bitmap => bitmap"
1395.PD 0
1396.IP "\fB\-activebitmap\fR => \fIbitmap\fR" 4
1397.IX Item "-activebitmap => bitmap"
1398.IP "\fB\-disabledbitmap\fR => \fIbitmap\fR" 4
1399.IX Item "-disabledbitmap => bitmap"
1400.PD
1401Specifies the bitmaps to display in the item in its normal, active and
1402disabled states.
1403\&\fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR.
1404.IP "\fB\-foreground\fR => \fIcolor\fR" 4
1405.IX Item "-foreground => color"
1406.PD 0
1407.IP "\fB\-activeforeground\fR => \fIbitmap\fR" 4
1408.IX Item "-activeforeground => bitmap"
1409.IP "\fB\-disabledforeground\fR => \fIbitmap\fR" 4
1410.IX Item "-disabledforeground => bitmap"
1411.PD
1412Specifies the color to use for each of the bitmap's '1' valued pixels
1413in its normal, active and disabled states.
1414\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR and
1415defaults to \fBblack\fR.
1416.IP "\fB\-state\fR => \fIstate\fR" 4
1417.IX Item "-state => state"
1418Modifies the state of the bitmap item where \fIstate\fR may be set to one of:
1419normal, disabled, or hidden. An bitmap item may also be in the \*(L"active\*(R"
1420state if the mouse is currently over it. Many options can take
1421separate specifications in normal, active and disabled states such that the
1422appearance of the item can be different in each state.
1423.IP "\fB\-tags\fR => \fItagList\fR" 4
1424.IX Item "-tags => tagList"
1425Specifies a set of tags to apply to the item.
1426\&\fITagList\fR consists of a list of tag names, which replace any
1427existing tags for the item.
1428\&\fITagList\fR may be an empty list.
1429.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
1430.IX Item "-updatecommand => command"
1431Specifies a callback that is to be executed every time
1432the bitmap item is updated on the screen.
1433.SH "GRID ITEMS"
1434.IX Header "GRID ITEMS"
1435Items of type \fBgrid\fR are intended for producing a visual reference for
1436interpreting other items. They can be drawn as either lines (with dash
1437style) or as rectangular \*(L"dots\*(R" at each grid point.
1438.PP
1439Items of type \fBgrid\fR are unlike other items they always cover the
1440whole of the canvas, but are never enclosed by nor overlap any area
1441and are not near any point. That is they are intended to be always visible
1442but not \*(L"pickable\*(R", as such they do support the \*(L"active\*(R" state.
1443They are like other items in that: multiple
1444grids are permitted, they can be raised and lowered relative to other
1445items, they can be moved and scaled. As yet grids do not apear in
1446PostScript output.
1447.PP
1448Grids have outline like configure options. Grids are created with methods of the
1449following form:
1450.PP
1451.Vb 1
1452\& $canvas->createGrid(x1, y1, x2, y2, ?option, value, option, value, ...?)
1453.Ve
1454.PP
1455The arguments \fIx1\fR, \fIy1\fR give the origin of the grid. \fIx2\fR, and \fIy2\fR give
1456the coordinates of the next grid point in their respective directions.
1457After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1458pairs, each of which sets one of the configuration options
1459for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1460used in \fBitemconfigure\fR methods to change the item's
1461configuration.
1462The following options are supported for grids:
1463.IP "\fB\-lines\fR => \fIboolean\fR" 4
1464.IX Item "-lines => boolean"
1465If \fB\-lines\fR is set to a true value then lines are drawn for both X and Y
1466grids in the style determined by \fB\-dash\fR. Otherwise retangular \*(L"dots\*(R"
1467are drawn at each grid point.
1468.IP "\fB\-dash\fR => \fIpattern\fR" 4
1469.IX Item "-dash => pattern"
1470.PD 0
1471.IP "\fB\-disableddash\fR => \fIpattern\fR" 4
1472.IX Item "-disableddash => pattern"
1473.PD
1474This option specifies dash patterns for the normal state,
1475and the disabled state of a grid item.
1476\&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
1477If the dash options are omitted then the default is a solid outline.
1478.IP "\fB\-dashoffset\fR => \fIoffset\fR" 4
1479.IX Item "-dashoffset => offset"
1480The starting \fIoffset\fR into the pattern provided by the
1481\&\fB\-dash\fR option.
1482\&\fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern.
1483.IP "\fB\-color\fR => \fIcolor\fR" 4
1484.IX Item "-color => color"
1485.PD 0
1486.IP "\fB\-disabledcolor\fR => \fIcolor\fR" 4
1487.IX Item "-disabledcolor => color"
1488.PD
1489This option specifies the color that should be used to draw the
1490outline of the grid in its normal and disabled states.
1491\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1492This option defaults to \fBblack\fR.
1493If \fIcolor\fR is undef then no grid will be drawn.
1494.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
1495.IX Item "-stipple => bitmap"
1496.PD 0
1497.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
1498.IX Item "-disabledstipple => bitmap"
1499.PD
1500This option specifies stipple patterns that should be used to draw the
1501outline of the rectangle in its normal and disabled states.
1502\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1503forms accepted by \fBTk_GetBitmap\fR.
1504If \fIbitmap\fR is an empty string (the default), then the outline is drawn
1505in a solid fashion.
1506.IP "\fB\-state\fR => \fIstate\fR" 4
1507.IX Item "-state => state"
1508Modifies the state of the rectangle item where \fIstate\fR may be set to one of:
1509normal, disabled, or hidden. Many options can take
1510separate specifications in normal and disabled states such that the
1511appearance of the item can be different in each state.
1512.IP "\fB\-tags\fR => \fItagList\fR" 4
1513.IX Item "-tags => tagList"
1514Specifies a set of tags to apply to the item.
1515\&\fITagList\fR consists of a list of tag names, which replace any
1516existing tags for the item.
1517\&\fITagList\fR may be an empty list.
1518.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
1519.IX Item "-updatecommand => command"
1520Specifies a callback that is to be executed every time
1521the grid item is updated on the screen.
1522.IP "\fB\-width\fR => \fIoutlineWidth\fR" 4
1523.IX Item "-width => outlineWidth"
1524.PD 0
1525.IP "\fB\-disabledwidth\fR => \fIoutlineWidth\fR" 4
1526.IX Item "-disabledwidth => outlineWidth"
1527.PD
1528Specifies the width of the lines drawn by the grid or the size (in both X and Y)
1529of the dots, in its normal and disabled states.
1530This option defaults to 1.0.
1531.SH "IMAGE ITEMS"
1532.IX Header "IMAGE ITEMS"
1533Items of type \fBimage\fR are used to display images on a
1534canvas.
1535Images are created with methods of the following form:
1536.PP
1537.Vb 1
1538\& $canvas->createImage(x, y, ?option, value, option, value, ...?)
1539.Ve
1540.PP
1541The arguments \fIx\fR and \fIy\fR specify the coordinates of a
1542point used to position the image on the display (see the \fB\-anchor\fR
1543option below for more information).
1544After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1545pairs, each of which sets one of the configuration options
1546for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1547used in \fBitemconfigure\fR methods to change the item's
1548configuration.
1549The following options are supported for images:
1550.IP "\fB\-anchor\fR => \fIanchorPos\fR" 4
1551.IX Item "-anchor => anchorPos"
1552\&\fIAnchorPos\fR tells how to position the image relative to the
1553positioning point for the item; it may have any of the forms
1554accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
1555is \fBcenter\fR then the image is centered on the point; if
1556\&\fIanchorPos\fR is \fBn\fR then the image will be drawn so that
1557its top center point is at the positioning point.
1558This option defaults to \fBcenter\fR.
1559.IP "\fB\-image\fR => \fIname\fR" 4
1560.IX Item "-image => name"
1561.PD 0
1562.IP "\fB\-activeimage\fR => \fIname\fR" 4
1563.IX Item "-activeimage => name"
1564.IP "\fB\-disabledimage\fR => \fIname\fR" 4
1565.IX Item "-disabledimage => name"
1566.PD
1567Specifies the name of the images to display in the item in is normal,
1568active and disabled states.
1569This image must have been created previously with the
1570\&\fBimageCreate\fR method.
1571.IP "\fB\-state\fR => \fIstate\fR" 4
1572.IX Item "-state => state"
1573Modifies the state of the image item where \fIstate\fR may be set to one of:
1574normal, disabled, or hidden. An image item may also be in the \*(L"active\*(R"
1575state if the mouse is currently over it. Many options can take
1576separate specifications in normal, active and disabled states such that the
1577appearance of the item can be different in each state.
1578.IP "\fB\-tags\fR => \fItagList\fR" 4
1579.IX Item "-tags => tagList"
1580Specifies a set of tags to apply to the item.
1581\&\fITagList\fR consists of a list of tag names, which replace any
1582existing tags for the item; it may be an empty list.
1583.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
1584.IX Item "-updatecommand => command"
1585Specifies a callback that is to be executed every time
1586the image item is updated on the screen.
1587.SH "LINE ITEMS"
1588.IX Header "LINE ITEMS"
1589Items of type \fBline\fR appear on the display as one or more connected
1590line segments or curves.
1591Line items support coordinate indexing operations using the canvas
1592methods: \fBdchars, index, insert.\fR
1593Lines are created with methods of the following form:
1594.PP
1595.Vb 1
1596\& $canvas->createLine(x1, y1..., xn, yn, ?option, value, option, value, ...?)
1597.Ve
1598.PP
1599The arguments \fIx1\fR through \fIyn\fR give
1600the coordinates for a series of two or more points that describe
1601a series of connected line segments.
1602After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1603pairs, each of which sets one of the configuration options
1604for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1605used in \fBitemconfigure\fR methods to change the item's
1606configuration.
1607The following options are supported for lines:
1608.IP "\fB\-arrow\fR => \fIwhere\fR" 4
1609.IX Item "-arrow => where"
1610Indicates whether or not arrowheads are to be drawn at one or both
1611ends of the line.
1612\&\fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads),
1613\&\fBfirst\fR (for an arrowhead at the first point of the line),
1614\&\fBlast\fR (for an arrowhead at the last point of the line), or
1615\&\fBboth\fR (for arrowheads at both ends).
1616This option defaults to \fBnone\fR.
1617.IP "\fB\-arrowshape\fR => \fIshape\fR" 4
1618.IX Item "-arrowshape => shape"
1619This option indicates how to draw arrowheads.
1620The \fIshape\fR argument must be a list with three elements, each
1621specifying a distance in any of the forms described in
1622the \*(L"\s-1COORDINATES\s0\*(R" section above.
1623The first element of the list gives the distance along the line
1624from the neck of the arrowhead to its tip.
1625The second element gives the distance along the line from the
1626trailing points of the arrowhead to the tip, and the third
1627element gives the distance from the outside edge of the line to the
1628trailing points.
1629If this option isn't specified then Tk picks a ``reasonable'' shape.
1630.IP "\fB\-capstyle\fR => \fIstyle\fR" 4
1631.IX Item "-capstyle => style"
1632Specifies the ways in which caps are to be drawn at the endpoints
1633of the line.
1634\&\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
1635(\fBbutt\fR, \fBprojecting\fR, or \fBround\fR).
1636If this option isn't specified then it defaults to \fBbutt\fR.
1637Where arrowheads are drawn the cap style is ignored.
1638.IP "\fB\-dash\fR => \fIpattern\fR" 4
1639.IX Item "-dash => pattern"
1640.PD 0
1641.IP "\fB\-activedash\fR => \fIpattern\fR" 4
1642.IX Item "-activedash => pattern"
1643.IP "\fB\-disableddash\fR => \fIpattern\fR" 4
1644.IX Item "-disableddash => pattern"
1645.PD
1646This option specifies dash patterns for the normal state, the active
1647state, and the disabled state of a line item.
1648\&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
1649If the dash options are omitted then the default is a solid outline.
1650.IP "\fB\-dashoffset\fR => \fIoffset\fR" 4
1651.IX Item "-dashoffset => offset"
1652The starting \fIoffset\fR into the pattern provided by the
1653\&\fB\-dash\fR option.
1654\&\fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern.
1655.IP "\fB\-fill\fR => \fIcolor\fR" 4
1656.IX Item "-fill => color"
1657.PD 0
1658.IP "\fB\-activefill\fR => \fIcolor\fR" 4
1659.IX Item "-activefill => color"
1660.IP "\fB\-disabledfill\fR => \fIcolor\fR" 4
1661.IX Item "-disabledfill => color"
1662.PD
1663Specifies the color to be used to fill the line in its normal, active, and
1664disabled states.
1665\&\fIColor\fR may have
1666any of the forms acceptable to \fBTk_GetColor\fR. It may also be undef,
1667in which case the line will be transparent.
1668This option defaults to \fBblack\fR.
1669.IP "\fB\-joinstyle\fR => \fIstyle\fR" 4
1670.IX Item "-joinstyle => style"
1671Specifies the ways in which joints are to be drawn at the vertices
1672of the line.
1673\&\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
1674(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
1675If this option isn't specified then it defaults to \fBmiter\fR.
1676If the line only contains two points then this option is
1677irrelevant.
1678.IP "\fB\-smooth\fR => \fIboolean\fR" 4
1679.IX Item "-smooth => boolean"
1680\&\fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR.
1681It indicates whether or not the line should be drawn as a curve.
1682If so, the line is rendered as a set of parabolic splines: one spline
1683is drawn for the first and second line segments, one for the second
1684and third, and so on. Straight-line segments can be generated within
1685a curve by duplicating the end-points of the desired line segment.
1686.IP "\fB\-splinesteps\fR => \fInumber\fR" 4
1687.IX Item "-splinesteps => number"
1688Specifies the degree of smoothness desired for curves: each spline
1689will be approximated with \fInumber\fR line segments. This
1690option is ignored unless the \fB\-smooth\fR option is true.
1691.IP "\fB\-state\fR => \fIstate\fR" 4
1692.IX Item "-state => state"
1693Modifies the state of the line item where \fIstate\fR may be set to one of:
1694normal, disabled, or hidden. A line item may also be in the \*(L"active\*(R"
1695state if the mouse is currently over it. Many options can take
1696separate specifications in normal, active and disabled states such that the
1697appearance of the item can be different in each state.
1698.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
1699.IX Item "-stipple => bitmap"
1700.PD 0
1701.IP "\fB\-activestipple\fR => \fIbitmap\fR" 4
1702.IX Item "-activestipple => bitmap"
1703.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
1704.IX Item "-disabledstipple => bitmap"
1705.PD
1706This option specifies stipple patterns that should be used to fill the
1707the line in its normal, active and disabled states.
1708\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1709forms accepted by \fBTk_GetBitmap\fR.
1710If \fIbitmap\fR is an empty string (the default), then filling is
1711done in a solid fashion.
1712.IP "\fB\-tags\fR => \fItagList\fR" 4
1713.IX Item "-tags => tagList"
1714Specifies a set of tags to apply to the item.
1715\&\fITagList\fR consists of a list of tag names, which replace any
1716existing tags for the item.
1717\&\fITagList\fR may be an empty list.
1718.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
1719.IX Item "-updatecommand => command"
1720Specifies a callback that is to be executed every time
1721the line item is updated on the screen.
1722.IP "\fB\-width\fR => \fIlineWidth\fR" 4
1723.IX Item "-width => lineWidth"
1724.PD 0
1725.IP "\fB\-activewidth\fR => \fIlineWidth\fR" 4
1726.IX Item "-activewidth => lineWidth"
1727.IP "\fB\-disabledwidth\fR => \fIlineWidth\fR" 4
1728.IX Item "-disabledwidth => lineWidth"
1729.PD
1730Specifies the width of the line
1731in its normal, active and disabled states.
1732\&\fIlineWidth\fR may be in any of the forms
1733described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
1734.Sp
1735Wide lines will be drawn centered on the path specified by the
1736points.
1737If this option isn't specified then it defaults to 1.0.
1738.SH "OVAL ITEMS"
1739.IX Header "OVAL ITEMS"
1740Items of type \fBoval\fR appear as circular or oval regions on
1741the display. Each oval may have an outline, a fill, or
1742both. Ovals are created with methods of the
1743following form:
1744.PP
1745.Vb 1
1746\& $canvas->createOval(x1, y1, x2, y2, ?option, value, option, value, ...?)
1747.Ve
1748.PP
1749The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
1750the coordinates of two diagonally opposite corners of a
1751rectangular region enclosing the oval.
1752The oval will include the top and left edges of the rectangle
1753not the lower or right edges.
1754If the region is square then the resulting oval is circular;
1755otherwise it is elongated in shape.
1756After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1757pairs, each of which sets one of the configuration options
1758for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1759used in \fBitemconfigure\fR methods to change the item's
1760configuration.
1761The following options are supported for ovals:
1762.IP "\fB\-dash\fR => \fIpattern\fR" 4
1763.IX Item "-dash => pattern"
1764.PD 0
1765.IP "\fB\-activedash\fR => \fIpattern\fR" 4
1766.IX Item "-activedash => pattern"
1767.IP "\fB\-disableddash\fR => \fIpattern\fR" 4
1768.IX Item "-disableddash => pattern"
1769.PD
1770This option specifies dash patterns for the normal state, the active
1771state, and the disabled state of an oval item.
1772\&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
1773If the dash options are omitted then the default is a solid outline.
1774.IP "\fB\-dashoffset\fR => \fIoffset\fR" 4
1775.IX Item "-dashoffset => offset"
1776The starting \fIoffset\fR into the pattern provided by the
1777\&\fB\-dash\fR option.
1778\&\fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern.
1779.IP "\fB\-fill\fR => \fIcolor\fR" 4
1780.IX Item "-fill => color"
1781.PD 0
1782.IP "\fB\-activefill\fR => \fIcolor\fR" 4
1783.IX Item "-activefill => color"
1784.IP "\fB\-disabledfill\fR => \fIcolor\fR" 4
1785.IX Item "-disabledfill => color"
1786.PD
1787Specifies the color to be used to fill the oval in its normal, active, and
1788disabled states.
1789\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1790If \fIcolor\fR is undef (the default), then
1791then the oval will not be filled.
1792.IP "\fB\-outline\fR => \fIcolor\fR" 4
1793.IX Item "-outline => color"
1794.PD 0
1795.IP "\fB\-activeoutline\fR => \fIcolor\fR" 4
1796.IX Item "-activeoutline => color"
1797.IP "\fB\-disabledoutline\fR => \fIcolor\fR" 4
1798.IX Item "-disabledoutline => color"
1799.PD
1800This option specifies the color that should be used to draw the
1801outline of the oval in its normal, active and disabled states.
1802\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1803This option defaults to \fBblack\fR.
1804If \fIcolor\fR is undef then no outline will be
1805drawn for the oval.
1806.IP "\fB\-outlinestipple\fR => \fIbitmap\fR" 4
1807.IX Item "-outlinestipple => bitmap"
1808.PD 0
1809.IP "\fB\-activeoutlinestipple\fR => \fIbitmap\fR" 4
1810.IX Item "-activeoutlinestipple => bitmap"
1811.IP "\fB\-disabledoutlinestipple\fR => \fIbitmap\fR" 4
1812.IX Item "-disabledoutlinestipple => bitmap"
1813.PD
1814This option specifies stipple patterns that should be used to draw the
1815outline of the oval in its normal, active and disabled states.
1816\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1817forms accepted by \fBTk_GetBitmap\fR.
1818If the \fB\-outline\fR option hasn't been specified then this option
1819has no effect.
1820If \fIbitmap\fR is an empty string (the default), then the outline is drawn
1821in a solid fashion.
1822.IP "\fB\-state\fR => \fIstate\fR" 4
1823.IX Item "-state => state"
1824Modifies the state of the oval item where \fIstate\fR may be set to one of:
1825normal, disabled, or hidden. An oval item may also be in the \*(L"active\*(R"
1826state if the mouse is currently over it. Many options can take
1827separate specifications in normal, active and disabled states such that the
1828appearance of the item can be different in each state.
1829.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
1830.IX Item "-stipple => bitmap"
1831.PD 0
1832.IP "\fB\-activestipple\fR => \fIbitmap\fR" 4
1833.IX Item "-activestipple => bitmap"
1834.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
1835.IX Item "-disabledstipple => bitmap"
1836.PD
1837This option specifies stipple patterns that should be used to fill the
1838the oval in its normal, active and disabled states.
1839\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1840forms accepted by \fBTk_GetBitmap\fR.
1841If the \fB\-fill\fR option hasn't been specified then this option
1842has no effect.
1843If \fIbitmap\fR is an empty string (the default), then filling is done
1844in a solid fashion.
1845.IP "\fB\-tags\fR => \fItagList\fR" 4
1846.IX Item "-tags => tagList"
1847Specifies a set of tags to apply to the item.
1848\&\fITagList\fR consists of a list of tag names, which replace any
1849existing tags for the item.
1850\&\fITagList\fR may be an empty list.
1851.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
1852.IX Item "-updatecommand => command"
1853Specifies a callback that is to be executed every time
1854the oval item is updated on the screen.
1855.IP "\fB\-width\fR => \fIoutlineWidth\fR" 4
1856.IX Item "-width => outlineWidth"
1857.PD 0
1858.IP "\fB\-activewidth\fR => \fIoutlineWidth\fR" 4
1859.IX Item "-activewidth => outlineWidth"
1860.IP "\fB\-disabledwidth\fR => \fIoutlineWidth\fR" 4
1861.IX Item "-disabledwidth => outlineWidth"
1862.PD
1863Specifies the width of the outline to be drawn around
1864the oval, in its normal, active and disabled states.
1865\&\fIoutlineWidth\fR specifies the width of the outline to be drawn around
1866the oval, in any of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
1867.Sp
1868If the \fB\-outline\fR option hasn't been specified then this option
1869has no effect.
1870Wide outlines are drawn centered on the oval path defined by
1871\&\fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
1872This option defaults to 1.0.
1873.SH "POLYGON ITEMS"
1874.IX Header "POLYGON ITEMS"
1875Items of type \fBpolygon\fR appear as polygonal or curved filled regions
1876on the display.
1877Polygon items support coordinate indexing operations using the canvas
1878methods: \fBdchars, index, insert.\fR
1879Polygons are created with methods of the following form:
1880.PP
1881.Vb 1
1882\& $canvas->createPolygon(x1, y1, ..., xn, yn, ?option, value, option, value, ...?)
1883.Ve
1884.PP
1885The arguments \fIx1\fR through \fIyn\fR specify the coordinates for
1886three or more points that define a closed polygon.
1887The first and last points may be the same; whether they are or not,
1888Tk will draw the polygon as a closed polygon.
1889After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
1890pairs, each of which sets one of the configuration options
1891for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
1892used in \fBitemconfigure\fR methods to change the item's
1893configuration.
1894The following options are supported for polygons:
1895.IP "\fB\-dash\fR => \fIpattern\fR" 4
1896.IX Item "-dash => pattern"
1897.PD 0
1898.IP "\fB\-activedash\fR => \fIpattern\fR" 4
1899.IX Item "-activedash => pattern"
1900.IP "\fB\-disableddash\fR => \fIpattern\fR" 4
1901.IX Item "-disableddash => pattern"
1902.PD
1903This option specifies dash patterns for the normal state, the active
1904state, and the disabled state of an polygon item.
1905\&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
1906If the dash options are omitted then the default is a solid outline.
1907.IP "\fB\-dashoffset\fR => \fIoffset\fR" 4
1908.IX Item "-dashoffset => offset"
1909The starting \fIoffset\fR into the pattern provided by the
1910\&\fB\-dash\fR option.
1911\&\fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern.
1912.IP "\fB\-fill\fR => \fIcolor\fR" 4
1913.IX Item "-fill => color"
1914.PD 0
1915.IP "\fB\-activefill\fR => \fIcolor\fR" 4
1916.IX Item "-activefill => color"
1917.IP "\fB\-disabledfill\fR => \fIcolor\fR" 4
1918.IX Item "-disabledfill => color"
1919.PD
1920Specifies the color to be used to fill the polygon in its normal, active, and
1921disabled states.
1922\&\fIColor\fR
1923may have any of the forms acceptable to \fBTk_GetColor\fR.
1924If \fIcolor\fR is undef then the polygon will be
1925transparent.
1926This option defaults to \fBblack\fR.
1927.IP "\fB\-joinstyle\fR => \fIstyle\fR" 4
1928.IX Item "-joinstyle => style"
1929Specifies the ways in which joints are to be drawn at the vertices
1930of the outline.
1931\&\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
1932(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
1933If this option isn't specified then it defaults to \fBmiter\fR.
1934.IP "\fB\-outline\fR => \fIcolor\fR" 4
1935.IX Item "-outline => color"
1936.PD 0
1937.IP "\fB\-activeoutline\fR => \fIcolor\fR" 4
1938.IX Item "-activeoutline => color"
1939.IP "\fB\-disabledoutline\fR => \fIcolor\fR" 4
1940.IX Item "-disabledoutline => color"
1941.PD
1942This option specifies the color that should be used to draw the
1943outline of the polygon in its normal, active and disabled states.
1944\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
1945If \fIcolor\fR is undef then no outline will be
1946drawn for the polygon.
1947This option defaults to undef (no outline).
1948.IP "\fB\-outlinestipple\fR => \fIbitmap\fR" 4
1949.IX Item "-outlinestipple => bitmap"
1950.PD 0
1951.IP "\fB\-activeoutlinestipple\fR => \fIbitmap\fR" 4
1952.IX Item "-activeoutlinestipple => bitmap"
1953.IP "\fB\-disabledoutlinestipple\fR => \fIbitmap\fR" 4
1954.IX Item "-disabledoutlinestipple => bitmap"
1955.PD
1956This option specifies stipple patterns that should be used to draw the
1957outline of the polygon in its normal, active and disabled states.
1958\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1959forms accepted by \fBTk_GetBitmap\fR.
1960If the \fB\-outline\fR option hasn't been specified then this option
1961has no effect.
1962If \fIbitmap\fR is an empty string (the default), then the outline is drawn
1963in a solid fashion.
1964.IP "\fB\-smooth\fR => \fIboolean\fR" 4
1965.IX Item "-smooth => boolean"
1966\&\fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR
1967It indicates whether or not the polygon should be drawn with a
1968curved perimeter.
1969If so, the outline of the polygon becomes a set of parabolic splines,
1970one spline for the first and second line segments, one for the second
1971and third, and so on. Straight-line segments can be generated in a
1972smoothed polygon by duplicating the end-points of the desired line segment.
1973.IP "\fB\-splinesteps\fR => \fInumber\fR" 4
1974.IX Item "-splinesteps => number"
1975Specifies the degree of smoothness desired for curves: each spline
1976will be approximated with \fInumber\fR line segments. This
1977option is ignored unless the \fB\-smooth\fR option is true.
1978.IP "\fB\-state\fR => \fIstate\fR" 4
1979.IX Item "-state => state"
1980Modifies the state of the polygon item where \fIstate\fR may be set to one of:
1981normal, disabled, or hidden. A polygon item may also be in the \*(L"active\*(R"
1982state if the mouse is currently over it. Many options can take
1983separate specifications in normal, active and disabled states such that the
1984appearance of the item can be different in each state.
1985.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
1986.IX Item "-stipple => bitmap"
1987.PD 0
1988.IP "\fB\-activestipple\fR => \fIbitmap\fR" 4
1989.IX Item "-activestipple => bitmap"
1990.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
1991.IX Item "-disabledstipple => bitmap"
1992.PD
1993This option specifies stipple patterns that should be used to fill the
1994the polygon in its normal, active and disabled states.
1995\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
1996forms accepted by \fBTk_GetBitmap\fR.
1997If \fIbitmap\fR is an empty string (the default), then filling is
1998done in a solid fashion.
1999.IP "\fB\-tags\fR => \fItagList\fR" 4
2000.IX Item "-tags => tagList"
2001Specifies a set of tags to apply to the item.
2002\&\fITagList\fR consists of a list of tag names, which replace any
2003existing tags for the item.
2004\&\fITagList\fR may be an empty list.
2005.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
2006.IX Item "-updatecommand => command"
2007Specifies a callback that is to be executed every time
2008the polygon item is updated on the screen.
2009.IP "\fB\-width\fR => \fIoutlineWidth\fR" 4
2010.IX Item "-width => outlineWidth"
2011.PD 0
2012.IP "\fB\-activewidth\fR => \fIoutlineWidth\fR" 4
2013.IX Item "-activewidth => outlineWidth"
2014.IP "\fB\-disabledwidth\fR => \fIoutlineWidth\fR" 4
2015.IX Item "-disabledwidth => outlineWidth"
2016.IP "Specifies the width of the outline to be drawn around" 4
2017.IX Item "Specifies the width of the outline to be drawn around"
2018.PD
2019the polygon, in its normal, active and disabled states.
2020\&\fIoutlineWidth\fR may be in any of the forms described in the \s-1COORDINATES\s0
2021section above.
2022\&\fIOutlineWidth\fR specifies the width of the outline to be drawn around
2023the polygon, in any of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
2024If the \fB\-outline\fR option hasn't been specified then this option
2025has no effect. This option defaults to 1.0.
2026.Sp
2027Polygon items are different from other items such as rectangles, ovals
2028and arcs in that interior points are considered to be ``inside'' a
2029polygon (e.g. for purposes of the \fBfind closest\fR and
2030\&\fBfind overlapping\fR methods) even if it is not filled.
2031For most other item types, an
2032interior point is considered to be inside the item only if the item
2033is filled or if it has neither a fill nor an outline. If you would
2034like an unfilled polygon whose interior points are not considered
2035to be inside the polygon, use a line item instead.
2036.SH "RECTANGLE ITEMS"
2037.IX Header "RECTANGLE ITEMS"
2038Items of type \fBrectangle\fR appear as rectangular regions on
2039the display. Each rectangle may have an outline, a fill, or
2040both. Rectangles are created with methods of the
2041following form:
2042.PP
2043.Vb 1
2044\& $canvas->createRectangle(x1, y1, x2, y2, ?option, value, option, value, ...?)
2045.Ve
2046.PP
2047The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
2048the coordinates of two diagonally opposite corners of the rectangle
2049(the rectangle will include its upper and left edges but not
2050its lower or right edges).
2051After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
2052pairs, each of which sets one of the configuration options
2053for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
2054used in \fBitemconfigure\fR methods to change the item's
2055configuration.
2056The following options are supported for rectangles:
2057.IP "\fB\-dash\fR => \fIpattern\fR" 4
2058.IX Item "-dash => pattern"
2059.PD 0
2060.IP "\fB\-activedash\fR => \fIpattern\fR" 4
2061.IX Item "-activedash => pattern"
2062.IP "\fB\-disableddash\fR => \fIpattern\fR" 4
2063.IX Item "-disableddash => pattern"
2064.PD
2065This option specifies dash patterns for the normal state, the active
2066state, and the disabled state of a rectangle item.
2067\&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
2068If the dash options are omitted then the default is a solid outline.
2069.IP "\fB\-dashoffset\fR => \fIoffset\fR" 4
2070.IX Item "-dashoffset => offset"
2071The starting \fIoffset\fR into the pattern provided by the
2072\&\fB\-dash\fR option.
2073\&\fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern.
2074.IP "\fB\-fill\fR => \fIcolor\fR" 4
2075.IX Item "-fill => color"
2076.PD 0
2077.IP "\fB\-activefill\fR => \fIcolor\fR" 4
2078.IX Item "-activefill => color"
2079.IP "\fB\-disabledfill\fR => \fIcolor\fR" 4
2080.IX Item "-disabledfill => color"
2081.PD
2082Specifies the color to be used to fill the rectangle in its normal, active, and
2083disabled states.
2084\&\fIColor\fR
2085may be specified in any of the forms accepted by \fBTk_GetColor\fR.
2086If \fIcolor\fR is undef (the default),
2087then the rectangle will not be filled.
2088.IP "\fB\-outline\fR => \fIcolor\fR" 4
2089.IX Item "-outline => color"
2090.PD 0
2091.IP "\fB\-activeoutline\fR => \fIcolor\fR" 4
2092.IX Item "-activeoutline => color"
2093.IP "\fB\-disabledoutline\fR => \fIcolor\fR" 4
2094.IX Item "-disabledoutline => color"
2095.PD
2096This option specifies the color that should be used to draw the
2097outline of the rectangle in its normal, active and disabled states.
2098\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
2099This option defaults to \fBblack\fR.
2100If \fIcolor\fR is undef then no outline will be
2101drawn for the rectangle.
2102.IP "\fB\-outlinestipple\fR => \fIbitmap\fR" 4
2103.IX Item "-outlinestipple => bitmap"
2104.PD 0
2105.IP "\fB\-activeoutlinestipple\fR => \fIbitmap\fR" 4
2106.IX Item "-activeoutlinestipple => bitmap"
2107.IP "\fB\-disabledoutlinestipple\fR => \fIbitmap\fR" 4
2108.IX Item "-disabledoutlinestipple => bitmap"
2109.PD
2110This option specifies stipple patterns that should be used to draw the
2111outline of the rectangle in its normal, active and disabled states.
2112\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
2113forms accepted by \fBTk_GetBitmap\fR.
2114If the \fB\-outline\fR option hasn't been specified then this option
2115has no effect.
2116If \fIbitmap\fR is an empty string (the default), then the outline is drawn
2117in a solid fashion.
2118.IP "\fB\-state\fR => \fIstate\fR" 4
2119.IX Item "-state => state"
2120Modifies the state of the rectangle item where \fIstate\fR may be set to one of:
2121normal, disabled, or hidden. A rectangle item may also be in the \*(L"active\*(R"
2122state if the mouse is currently over it. Many options can take
2123separate specifications in normal, active and disabled states such that the
2124appearance of the item can be different in each state.
2125.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
2126.IX Item "-stipple => bitmap"
2127.PD 0
2128.IP "\fB\-activestipple\fR => \fIbitmap\fR" 4
2129.IX Item "-activestipple => bitmap"
2130.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
2131.IX Item "-disabledstipple => bitmap"
2132.PD
2133This option specifies stipple patterns that should be used to fill the
2134the rectangle in its normal, active and disabled states.
2135\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
2136forms accepted by \fBTk_GetBitmap\fR.
2137If the \fB\-fill\fR option hasn't been specified then this option
2138has no effect.
2139If \fIbitmap\fR is an empty string (the default), then filling
2140is done in a solid fashion.
2141.IP "\fB\-tags\fR => \fItagList\fR" 4
2142.IX Item "-tags => tagList"
2143Specifies a set of tags to apply to the item.
2144\&\fITagList\fR consists of a list of tag names, which replace any
2145existing tags for the item.
2146\&\fITagList\fR may be an empty list.
2147.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
2148.IX Item "-updatecommand => command"
2149Specifies a callback that is to be executed every time
2150the rectangle item is updated on the screen.
2151.IP "\fB\-width\fR => \fIoutlineWidth\fR" 4
2152.IX Item "-width => outlineWidth"
2153.PD 0
2154.IP "\fB\-activewidth\fR => \fIoutlineWidth\fR" 4
2155.IX Item "-activewidth => outlineWidth"
2156.IP "\fB\-disabledwidth\fR => \fIoutlineWidth\fR" 4
2157.IX Item "-disabledwidth => outlineWidth"
2158.PD
2159Specifies the width of the outline to be drawn around
2160the rectangle, in its normal, active and disabled states.
2161\&\fIOutlineWidth\fR specifies the width of the outline to be drawn around
2162the rectangle, in any of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
2163.Sp
2164If the \fB\-outline\fR option hasn't been specified then this option
2165has no effect.
2166Wide outlines are drawn centered on the rectangular path
2167defined by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
2168This option defaults to 1.0.
2169.SH "TEXT ITEMS"
2170.IX Header "TEXT ITEMS"
2171A text item displays a string of characters on the screen in one
2172or more lines.
2173Text items support indexing and selection, along with the
2174following text-related canvas methods: \fBdchars\fR,
2175\&\fBfocus\fR, \fBicursor\fR, \fBindex\fR, \fBinsert\fR,
2176\&\fBselect\fR.
2177Text items are created with methods of the following
2178form:
2179.PP
2180.Vb 1
2181\& $canvas->createText(x, y, ?option, value, option, value, ...?)
2182.Ve
2183.PP
2184The arguments \fIx\fR and \fIy\fR specify the coordinates of a
2185point used to position the text on the display (see the options
2186below for more information on how text is displayed).
2187After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
2188pairs, each of which sets one of the configuration options
2189for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
2190used in \fBitemconfigure\fR methods to change the item's
2191configuration.
2192The following options are supported for text items:
2193.IP "\fB\-anchor\fR => \fIanchorPos\fR" 4
2194.IX Item "-anchor => anchorPos"
2195\&\fIAnchorPos\fR tells how to position the text relative to the
2196positioning point for the text; it may have any of the forms
2197accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
2198is \fBcenter\fR then the text is centered on the point; if
2199\&\fIanchorPos\fR is \fBn\fR then the text will be drawn such that
2200the top center point of the rectangular region occupied by the
2201text will be at the positioning point.
2202This option defaults to \fBcenter\fR.
2203.IP "\fB\-fill\fR => \fIcolor\fR" 4
2204.IX Item "-fill => color"
2205.PD 0
2206.IP "\fB\-activefill\fR => \fIcolor\fR" 4
2207.IX Item "-activefill => color"
2208.IP "\fB\-disabledfill\fR => \fIcolor\fR" 4
2209.IX Item "-disabledfill => color"
2210.PD
2211Specifies the color to be used to fill the text in its normal, active, and
2212disabled states.
2213\&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
2214If \fIcolor\fR is undef then the text will be transparent.
2215If this option isn't specified then it defaults to \fBblack\fR.
2216.IP "\fB\-font\fR => \fIfontName\fR" 4
2217.IX Item "-font => fontName"
2218Specifies the font to use for the text item.
2219\&\fIFontName\fR may be any string acceptable to \fBTk_GetFontStruct\fR.
2220If this option isn't specified, it defaults to a system-dependent
2221font.
2222.IP "\fB\-justify\fR => \fIhow\fR" 4
2223.IX Item "-justify => how"
2224Specifies how to justify the text within its bounding region.
2225\&\fIHow\fR must be one of the values \fBleft\fR, \fBright\fR,
2226or \fBcenter\fR.
2227This option will only matter if the text is displayed as multiple
2228lines.
2229If the option is omitted, it defaults to \fBleft\fR.
2230.IP "\fB\-state\fR => \fIstate\fR" 4
2231.IX Item "-state => state"
2232Modifies the state of the text item where \fIstate\fR may be set to one of:
2233normal, disabled, or hidden. A text item may also be in the \*(L"active\*(R"
2234state if the mouse is currently over it. Many options can take
2235separate specifications in normal, active and disabled states such that the
2236appearance of the item can be different in each state.
2237.IP "\fB\-stipple\fR => \fIbitmap\fR" 4
2238.IX Item "-stipple => bitmap"
2239.PD 0
2240.IP "\fB\-activestipple\fR => \fIbitmap\fR" 4
2241.IX Item "-activestipple => bitmap"
2242.IP "\fB\-disabledstipple\fR => \fIbitmap\fR" 4
2243.IX Item "-disabledstipple => bitmap"
2244.PD
2245This option specifies stipple patterns that should be used to fill the
2246the text in its normal, active and disabled states.
2247\&\fIbitmap\fR specifies the stipple pattern to use, in any of the
2248forms accepted by \fBTk_GetBitmap\fR.
2249If \fIbitmap\fR is an empty string (the default) then the text
2250is drawn in a solid fashion.
2251.IP "\fB\-tags\fR => \fItagList\fR" 4
2252.IX Item "-tags => tagList"
2253Specifies a set of tags to apply to the item.
2254\&\fITagList\fR consists of a list of tag names, which replace any
2255existing tags for the item.
2256\&\fITagList\fR may be an empty list.
2257.IP "\fB\-text\fR => \fIstring\fR" 4
2258.IX Item "-text => string"
2259\&\fIString\fR specifies the characters to be displayed in the text item.
2260Newline characters cause line breaks.
2261The characters in the item may also be changed with the
2262\&\fBinsert\fR and \fBdelete\fR methods.
2263This option defaults to an empty string.
2264.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
2265.IX Item "-updatecommand => command"
2266Specifies a callback that is to be executed every time
2267the text item is updated on the screen.
2268.IP "\fB\-width\fR => \fIlineLength\fR" 4
2269.IX Item "-width => lineLength"
2270Specifies a maximum line length for the text, in any of the forms
2271described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
2272If this option is zero (the default) the text is broken into
2273lines only at newline characters.
2274However, if this option is non-zero then any line that would
2275be longer than \fIlineLength\fR is broken just before a space
2276character to make the line shorter than \fIlineLength\fR; the
2277space character is treated as if it were a newline
2278character.
2279.SH "WINDOW ITEMS"
2280.IX Header "WINDOW ITEMS"
2281Items of type \fBwindow\fR cause a particular window to be displayed
2282at a given position on the canvas.
2283Window items are created with methods of the following form:
2284.PP
2285\&\ \fI$canvas\fR\->\fBcreateWindow\fR(\fIx, y\fR?, \fI\-option\fR=>\fIvalue\fR, \fI\-option\fR=>\fIvalue\fR, ...?)
2286.PP
2287The arguments \fIx\fR and \fIy\fR specify the coordinates of a
2288point used to position the window on the display (see the \fB\-anchor\fR
2289option below for more information on how bitmaps are displayed).
2290After the coordinates there may be any number of \fIoption-value\fR
2291pairs, each of which sets one of the configuration options
2292for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
2293used in \fBitemconfigure\fR method to change the item's
2294configuration.
2295The following options are supported for window items:
2296.IP "\fB\-anchor\fR => \fIanchorPos\fR" 4
2297.IX Item "-anchor => anchorPos"
2298\&\fIAnchorPos\fR tells how to position the window relative to the
2299positioning point for the item; it may have any of the forms
2300accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
2301is \fBcenter\fR then the window is centered on the point; if
2302\&\fIanchorPos\fR is \fBn\fR then the window will be drawn so that
2303its top center point is at the positioning point.
2304This option defaults to \fBcenter\fR.
2305.IP "\fB\-height\fR => \fIpixels\fR" 4
2306.IX Item "-height => pixels"
2307Specifies the height to assign to the item's window.
2308\&\fIPixels\fR may have any of the
2309forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
2310If this option isn't specified, or if it is specified as an empty
2311string, then the window is given whatever height it requests internally.
2312.IP "\fB\-state\fR => \fIstate\fR" 4
2313.IX Item "-state => state"
2314Modifies the state of the window item where \fIstate\fR may be set to one of:
2315normal, disabled, or hidden.
2316.IP "\fB\-tags\fR => \fItagList\fR" 4
2317.IX Item "-tags => tagList"
2318Specifies a set of tags to apply to the item.
2319\&\fITagList\fR consists of a list of tag names, which replace any
2320existing tags for the item.
2321\&\fITagList\fR may be an empty list.
2322.IP "\fB\-updatecommand\fR => \fIcommand\fR" 4
2323.IX Item "-updatecommand => command"
2324Specifies a callback that is to be executed every time
2325the window item is updated on the screen.
2326.IP "\fB\-width\fR => \fIpixels\fR" 4
2327.IX Item "-width => pixels"
2328Specifies the width to assign to the item's window.
2329\&\fIPixels\fR may have any of the
2330forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above.
2331If this option isn't specified, or if it is specified as an empty
2332string, then the window is given whatever width it requests internally.
2333.IP "\fB\-window\fR => \fI$widget\fR" 4
2334.IX Item "-window => $widget"
2335Specifies the window to associate with this item.
2336The window specified by \f(CW$widget\fR must either be a child of
2337the canvas widget or a child of some ancestor of the canvas widget.
2338\&\fIPathName\fR may not refer to a top-level window.
2339.Sp
2340Note: due to restrictions in the ways that windows are managed, it is not
2341possible to draw other graphical items (such as lines and images) on top
2342of window items. A window item always obscures any graphics that
2343overlap it, regardless of their order in the display list.
2344.SH "APPLICATION-DEFINED ITEM TYPES"
2345.IX Header "APPLICATION-DEFINED ITEM TYPES"
2346It is possible for individual applications to define new item
2347types for canvas widgets using C code.
2348See the documentation for \fBTk_CreateItemType\fR.
2349.SH "BINDINGS"
2350.IX Header "BINDINGS"
2351Canvas has default bindings to allow scrolling if necessary:
2352<Up>, <Down>, <Left> and <Right> (and their <Control\-*> counter
2353parts). Further <Proir>, <Next>, <Home> and <End>. These
2354bindings allow you to navigate the same way as in other
2355widgets that can scroll.
2356.SH "CREDITS"
2357.IX Header "CREDITS"
2358Tk's canvas widget is a blatant ripoff of ideas from Joel Bartlett's
2359\&\fIezd\fR program. \fIEzd\fR provides structured graphics in a Scheme
2360environment and preceded canvases by a year or two. Its simple
2361mechanisms for placing and animating graphical objects inspired the
2362functions of canvases.
2363.SH "KEYWORDS"
2364.IX Header "KEYWORDS"
2365canvas, widget