| 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" |
| 134 | Tk::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 |
| 155 | Specifies a floating-point value indicating how close the mouse cursor |
| 156 | must be to an item before it is considered to be ``inside'' the item. |
| 157 | Defaults 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 |
| 166 | Specifies a boolean value that indicates whether or not it should be |
| 167 | allowable to set the canvas's view outside the region defined by the |
| 168 | \&\fBscrollRegion\fR argument. |
| 169 | Defaults to true, which means that the view will |
| 170 | be 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 |
| 179 | Specifies a desired window height that the canvas widget should request from |
| 180 | its geometry manager. The value may be specified in any |
| 181 | of 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 |
| 190 | Specifies a list with four coordinates describing the left, top, right, and |
| 191 | bottom coordinates of a rectangular region. |
| 192 | This region is used for scrolling purposes and is considered to be |
| 193 | the boundary of the information in the canvas. |
| 194 | Each of the coordinates may be specified |
| 195 | in 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 |
| 204 | Modifies the default state of the canvas where \fIstate\fR may be set to one of: |
| 205 | normal, disabled, or hidden. Individual canvas objects all have their own |
| 206 | state option, which overrides the default state. Many options can take |
| 207 | separate specifications such that the appearance of the item can be different |
| 208 | in different situations. The options that start with \*(L"active\*(R" control the |
| 209 | appearence when the mouse pointer is over it, while the option starting |
| 210 | with \*(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 |
| 219 | Specifies a desired window width that the canvas widget should request from |
| 220 | its geometry manager. The value may be specified in any |
| 221 | of 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 |
| 230 | Specifies an increment for horizontal scrolling, in any of the usual forms |
| 231 | permitted for screen distances. If the value of this option is greater |
| 232 | than zero, the horizontal view in the window will be constrained so that |
| 233 | the canvas x coordinate at the left edge of the window is always an even |
| 234 | multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling |
| 235 | (e.g., the change in view when the left and right arrows of a scrollbar |
| 236 | are selected) will also be \fBxScrollIncrement\fR. If the value of |
| 237 | this option is less than or equal to zero, then horizontal scrolling |
| 238 | is 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 |
| 247 | Specifies an increment for vertical scrolling, in any of the usual forms |
| 248 | permitted for screen distances. If the value of this option is greater |
| 249 | than zero, the vertical view in the window will be constrained so that |
| 250 | the canvas y coordinate at the top edge of the window is always an even |
| 251 | multiple of \fByScrollIncrement\fR; furthermore, the units for scrolling |
| 252 | (e.g., the change in view when the top and bottom arrows of a scrollbar |
| 253 | are selected) will also be \fByScrollIncrement\fR. If the value of |
| 254 | this option is less than or equal to zero, then vertical scrolling |
| 255 | is unconstrained. |
| 256 | .SH "DESCRIPTION" |
| 257 | .IX Header "DESCRIPTION" |
| 258 | The \fBCanvas\fR method creates a new window (given |
| 259 | by the \f(CW$canvas\fR argument) and makes it into a canvas widget. |
| 260 | Additional options, described above, may be specified on the |
| 261 | command line or in the option database |
| 262 | to configure aspects of the canvas such as its colors and 3\-D relief. |
| 263 | The \fBcanvas\fR command returns its |
| 264 | \&\f(CW$canvas\fR argument. At the time this command is invoked, |
| 265 | there must not exist a window named \f(CW$canvas\fR, but |
| 266 | \&\f(CW$canvas\fR's parent must exist. |
| 267 | .PP |
| 268 | Canvas widgets implement structured graphics. |
| 269 | A canvas displays any number of \fIitems\fR, which may be things like |
| 270 | rectangles, circles, lines, and text. |
| 271 | Items may be manipulated (e.g. moved or re\-colored) and |
| 272 | callbacks may |
| 273 | be associated with items in much the same way that the bind |
| 274 | method allows callbacks to be bound to widgets. For example, |
| 275 | a particular callback may be associated with the \fB<Button\-1>\fR event |
| 276 | so that the callback is invoked whenever button 1 is pressed with |
| 277 | the mouse cursor over an item. |
| 278 | This means that items in a canvas can have behaviors defined by |
| 279 | the Callbacks bound to them. |
| 280 | .SH "DISPLAY LIST" |
| 281 | .IX Header "DISPLAY LIST" |
| 282 | The items in a canvas are ordered for purposes of display, |
| 283 | with the first item in the display list being displayed |
| 284 | first, followed by the next item in the list, and so on. |
| 285 | Items later in the display list obscure those that are |
| 286 | earlier in the display list and are sometimes referred to |
| 287 | as being \fI``on top''\fR of earlier items. |
| 288 | When a new item is created it is placed at the end of the |
| 289 | display list, on top of everything else. |
| 290 | Widget methods may be used to re-arrange the order of the |
| 291 | display list. |
| 292 | .PP |
| 293 | Window items are an exception to the above rules. The underlying |
| 294 | window systems require them always to be drawn on top of other items. |
| 295 | In addition, the stacking order of window items |
| 296 | is not affected by any of the canvas methods; you must use |
| 297 | the raise and lower Tk widget methods instead. |
| 298 | .SH "ITEM IDS AND TAGS" |
| 299 | .IX Header "ITEM IDS AND TAGS" |
| 300 | Items in a canvas widget may be named in either of two ways: |
| 301 | by id or by tag. |
| 302 | Each item has a unique identifying number which is assigned to |
| 303 | that item when it is created. The id of an item never changes |
| 304 | and id numbers are never re-used within the lifetime of a |
| 305 | canvas widget. |
| 306 | .PP |
| 307 | Each item may also have any number of \fItags\fR associated |
| 308 | with it. A tag is just a string of characters, and it may |
| 309 | take any form except that of an integer. |
| 310 | For example, ``x123'' is \s-1OK\s0 but ``123'' isn't. |
| 311 | The same tag may be associated with many different items. |
| 312 | This is commonly done to group items in various interesting |
| 313 | ways; for example, all selected items might be given the |
| 314 | tag ``selected''. |
| 315 | .PP |
| 316 | The tag \fBall\fR is implicitly associated with every item |
| 317 | in the canvas; it may be used to invoke operations on |
| 318 | all the items in the canvas. |
| 319 | .PP |
| 320 | The tag \fBcurrent\fR is managed automatically by Tk; |
| 321 | it applies to the \fIcurrent item\fR, which is the |
| 322 | topmost item whose drawn area covers the position of |
| 323 | the mouse cursor. |
| 324 | If the mouse is not in the canvas widget or is not over |
| 325 | an item, then no item has the \fBcurrent\fR tag. |
| 326 | .PP |
| 327 | When specifying items in canvas methods, if the |
| 328 | specifier is an integer then it is assumed to refer to |
| 329 | the single item with that id. |
| 330 | If the specifier is not an integer, then it is assumed to |
| 331 | refer to all of the items in the canvas that have a tag |
| 332 | matching the specifier. |
| 333 | The symbol \fItagOrId\fR is used below to indicate that |
| 334 | an argument specifies either an id that selects a single |
| 335 | item or a tag that selects zero or more items. |
| 336 | .PP |
| 337 | \&\fItagOrId\fR may contain a logical expressions of |
| 338 | tags by using operators: '&&', '||', '^' '!', and parenthezised |
| 339 | subexpressions. For example: |
| 340 | .PP |
| 341 | $c\->find('withtag', '(a&&!b)|(!a&&b)'); |
| 342 | .PP |
| 343 | or equivalently: |
| 344 | .PP |
| 345 | $c\->find('withtag', 'a^b'); |
| 346 | .PP |
| 347 | will find only those items with either \*(L"a\*(R" or \*(L"b\*(R" tags, but not both. |
| 348 | .PP |
| 349 | Some methods only operate on a single item at a |
| 350 | time; if \fItagOrId\fR is specified in a way that |
| 351 | names multiple items, then the normal behavior is for |
| 352 | the methods is to use the first (lowest) of these items in |
| 353 | the display list that is suitable for the method. |
| 354 | Exceptions are noted in the method descriptions |
| 355 | below. |
| 356 | .SH "COORDINATES" |
| 357 | .IX Header "COORDINATES" |
| 358 | All coordinates related to canvases are stored as floating-point |
| 359 | numbers. |
| 360 | Coordinates and distances are specified in screen units, |
| 361 | which are floating-point numbers optionally followed |
| 362 | by one of several letters. |
| 363 | If no letter is supplied then the distance is in pixels. |
| 364 | If the letter is \fBm\fR then the distance is in millimeters on |
| 365 | the 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). |
| 367 | Larger y\-coordinates refer to points lower on the screen; larger |
| 368 | x\-coordinates refer to points farther to the right. |
| 369 | .SH "TRANSFORMATIONS" |
| 370 | .IX Header "TRANSFORMATIONS" |
| 371 | Normally the origin of the canvas coordinate system is at the |
| 372 | upper-left corner of the window containing the canvas. |
| 373 | It is possible to adjust the origin of the canvas |
| 374 | coordinate system relative to the origin of the window using the |
| 375 | \&\fBxview\fR and \fByview\fR methods; this is typically used |
| 376 | for scrolling. |
| 377 | Canvases do not support scaling or rotation of the canvas coordinate |
| 378 | system relative to the window coordinate system. |
| 379 | .PP |
| 380 | Individual items may be moved or scaled using methods |
| 381 | described below, but they may not be rotated. |
| 382 | .SH "INDICES" |
| 383 | .IX Header "INDICES" |
| 384 | Text items support the notion of an \fIindex\fR for identifying |
| 385 | particular positions within the item. |
| 386 | .PP |
| 387 | Indices are used for methods such as inserting text, deleting |
| 388 | a range of characters, and setting the insertion cursor position. |
| 389 | An index may be specified in any of a number of ways, and |
| 390 | different types of items may support different forms for |
| 391 | specifying indices. |
| 392 | .PP |
| 393 | In a similar fashion, line and polygon items support \fIindex\fR for |
| 394 | identifying, inserting and deleting subsets of their coordinates. |
| 395 | Indices are used for commands such as inserting or deleting |
| 396 | a range of characters or coordinates, and setting the insertion |
| 397 | cursor position. An index may be specified in any of a number |
| 398 | of ways, and different types of items may support different forms |
| 399 | for specifying indices. |
| 400 | .PP |
| 401 | Text items support the following forms for an index; if you |
| 402 | define new types of text-like items, it would be advisable to |
| 403 | support as many of these forms as practical. |
| 404 | Note that it is possible to refer to the character just after |
| 405 | the last one in the text item; this is necessary for such |
| 406 | tasks as inserting new text at the end of the item. |
| 407 | Lines and Polygons don't support the insertion cursor |
| 408 | and the selection. Their indices are supposed to be even |
| 409 | always, because coordinates always appear in pairs. |
| 410 | .IP "\fInumber\fR" 4 |
| 411 | .IX Item "number" |
| 412 | A decimal number giving the position of the desired character |
| 413 | within the text item. |
| 414 | 0 refers to the first character, 1 to the next character, and |
| 415 | so on. If indexes are odd for lines and polygons, they will be |
| 416 | automatically decremented by one. |
| 417 | A number less than 0 is treated as if it were zero, and a |
| 418 | number greater than the length of the text item is treated |
| 419 | as if it were equal to the length of the text item. For |
| 420 | polygons, numbers less than 0 or greater then the length |
| 421 | of the coordinate list will be adjusted by adding or substracting |
| 422 | the length until the result is between zero and the length, |
| 423 | inclusive. |
| 424 | .IP "\fBend\fR" 4 |
| 425 | .IX Item "end" |
| 426 | Refers to the character or coordinate just after the last one |
| 427 | in the item (same as the number of characters or coordinates |
| 428 | in the item). |
| 429 | .IP "\fBinsert\fR" 4 |
| 430 | .IX Item "insert" |
| 431 | Refers to the character just before which the insertion cursor |
| 432 | is drawn in this item. Not valid for lines and polygons. |
| 433 | .IP "\fBsel.first\fR" 4 |
| 434 | .IX Item "sel.first" |
| 435 | Refers to the first selected character in the item. |
| 436 | If the selection isn't in this item then this form is illegal. |
| 437 | .IP "\fBsel.last\fR" 4 |
| 438 | .IX Item "sel.last" |
| 439 | Refers to the last selected character in the item. |
| 440 | If 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]" |
| 443 | Refers 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 |
| 445 | system of the canvas. |
| 446 | If \fIx\fR and \fIy\fR lie outside the coordinates covered by the |
| 447 | text item, then they refer to the first or last character in the |
| 448 | line that is closest to the given point. |
| 449 | The Tcl string form \*(L"@x,y\*(R" is also allowed. |
| 450 | .SH "DASH PATTERNS" |
| 451 | .IX Header "DASH PATTERNS" |
| 452 | Many items support the notion of an dash pattern for outlines. |
| 453 | .PP |
| 454 | The first possible syntax is a list of integers. Each element |
| 455 | represents the number of pixels of a line segment. Only the odd |
| 456 | segments are drawn using the \*(L"outline\*(R" color. The other segments |
| 457 | are drawn transparant. |
| 458 | .PP |
| 459 | The second possible syntax is a character list containing only |
| 460 | 5 possible characters \fB[.,\-_ ]\fR. The space can be used |
| 461 | to enlarge the space between other line elements, and can not |
| 462 | occur 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 |
| 473 | The main difference of this syntax with the previous is that it |
| 474 | it shape\-conserving. This means that all values in the dash |
| 475 | list will be multiplied by the line width before display. This |
| 476 | assures that \*(L".\*(R" will always be displayed as a dot and \*(L"\-\*(R" |
| 477 | always as a dash regardless of the line width. |
| 478 | .PP |
| 479 | On systems where only a limited set of dash patterns, the dash |
| 480 | pattern will be displayed as the most close dash pattern that |
| 481 | is available. For example, on Windows only the first 4 of the |
| 482 | above examples are available. The last 2 examples will be |
| 483 | displayed identically as the first one. |
| 484 | .SH "WIDGET METHODS" |
| 485 | .IX Header "WIDGET METHODS" |
| 486 | The \fBCanvas\fR method creates a widget object. |
| 487 | This object supports the \fBconfigure\fR and \fBcget\fR methods |
| 488 | described in Tk::options which can be used to enquire and |
| 489 | modify the options described above. |
| 490 | The widget also inherits all the methods provided by the generic |
| 491 | Tk::Widget class. |
| 492 | .PP |
| 493 | The 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, ...?)" |
| 496 | For 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 |
| 499 | isn't already present on that list. |
| 500 | It is possible that no items will satisfy the constraints |
| 501 | given by \fIsearchSpec\fR and \fIarg\fRs, in which case the |
| 502 | method has no effect. |
| 503 | This command returns an empty string as result. |
| 504 | \&\fISearchSpec\fR and \fIarg\fR's may take any of the following |
| 505 | forms: |
| 506 | .RS 4 |
| 507 | .IP "\fBabove \fR\fItagOrId\fR" 8 |
| 508 | .IX Item "above tagOrId" |
| 509 | Selects the item just after (above) the one given by \fItagOrId\fR |
| 510 | in the display list. |
| 511 | If \fItagOrId\fR denotes more than one item, then the last (topmost) |
| 512 | of these items in the display list is used. |
| 513 | .IP "\fBall\fR" 8 |
| 514 | .IX Item "all" |
| 515 | Selects all the items in the canvas. |
| 516 | .IP "\fBbelow \fR\fItagOrId\fR" 8 |
| 517 | .IX Item "below tagOrId" |
| 518 | Selects the item just before (below) the one given by \fItagOrId\fR |
| 519 | in the display list. |
| 520 | If \fItagOrId\fR denotes more than one item, then the first (lowest) |
| 521 | of 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?" |
| 524 | Selects the item closest to the point given by \fIx\fR and \fIy\fR. |
| 525 | If more than one item is at the same closest distance (e.g. two |
| 526 | items overlap the point), then the top-most of these items (the |
| 527 | last one in the display list) is used. |
| 528 | If \fIhalo\fR is specified, then it must be a non-negative |
| 529 | value. |
| 530 | Any item closer than \fIhalo\fR to the point is considered to |
| 531 | overlap it. |
| 532 | The \fIstart\fR argument may be used to step circularly through |
| 533 | all the closest items. |
| 534 | If \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 |
| 536 | the given tag). |
| 537 | Instead of selecting the topmost closest item, this form will |
| 538 | select the topmost closest item that is below \fIstart\fR in |
| 539 | the display list; if no such item exists, then the selection |
| 540 | behaves 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" |
| 543 | Selects all the items completely enclosed within the rectangular |
| 544 | region 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 |
| 546 | no 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" |
| 549 | Selects all the items that overlap or are enclosed within the |
| 550 | rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, |
| 551 | and \fIy2\fR. |
| 552 | \&\fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be |
| 553 | no greater than \fIy2\fR. |
| 554 | .IP "\fBwithtag \fR\fItagOrId\fR" 8 |
| 555 | .IX Item "withtag tagOrId" |
| 556 | Selects 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, ...?)" |
| 562 | Returns a list with four elements giving an approximate bounding box |
| 563 | for all the items named by the \fItagOrId\fR arguments. |
| 564 | The list has the form ``\fIx1 y1 x2 y2\fR'' such that the drawn |
| 565 | areas 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, |
| 567 | and \fIy2\fR on the bottom. |
| 568 | The return value may overestimate the actual bounding box by |
| 569 | a few pixels. |
| 570 | If no items match any of the \fItagOrId\fR arguments or if the |
| 571 | matching items have empty bounding boxes (i.e. they have nothing |
| 572 | to display) |
| 573 | then 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?)" |
| 576 | This 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 |
| 579 | be invoked. |
| 580 | This method is similar to the \fBbind\fR method except that |
| 581 | it operates on items in a canvas rather than entire widgets. |
| 582 | See Tk::bind for complete details |
| 583 | on the syntax of \fIsequence\fR and the substitutions performed |
| 584 | on \fIcallback\fR before invoking it. |
| 585 | If all arguments are specified then a new binding is created, replacing |
| 586 | any existing binding for the same \fIsequence\fR and \fItagOrId\fR |
| 587 | (if the first character of \fIcommand\fR is ``+'' then \fIcommand\fR |
| 588 | augments an existing binding rather than replacing it). |
| 589 | In this case the return value is an empty string. |
| 590 | If \fIcallback\fR is omitted then the method returns the \fIcallback\fR |
| 591 | associated with \fItagOrId\fR and \fIsequence\fR (an error occurs |
| 592 | if there is no such binding). |
| 593 | If both \fIcallback\fR and \fIsequence\fR are omitted then the method |
| 594 | returns a list of all the sequences for which bindings have been |
| 595 | defined for \fItagOrId\fR. |
| 596 | .RS 4 |
| 597 | .Sp |
| 598 | .RS 8 |
| 599 | The only events for which bindings may be specified are those related to |
| 600 | the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR, |
| 601 | \&\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR) or virtual events. |
| 602 | The handling of events in canvases uses the current item defined |
| 603 | in \*(L"\s-1ITEM\s0 \s-1IDS\s0 \s-1AND\s0 \s-1TAGS\s0\*(R" above. \fBEnter\fR and \fBLeave\fR events trigger for an |
| 604 | item when it becomes the current item or ceases to be the current item; |
| 605 | note that these events are different than \fBEnter\fR and \fBLeave\fR |
| 606 | events for windows. Mouse-related events are directed to the current |
| 607 | item, if any. Keyboard-related events are directed to the focus item, if |
| 608 | any (see the focus method below for more on this). If a |
| 609 | virtual event is used in a binding, that binding can trigger only if the |
| 610 | virtual event is defined by an underlying mouse-related or |
| 611 | keyboard-related event. |
| 612 | .Sp |
| 613 | It is possible for multiple bindings to match a particular event. |
| 614 | This could occur, for example, if one binding is associated with the |
| 615 | item's id and another is associated with one of the item's tags. |
| 616 | When this occurs, all of the matching bindings are invoked. |
| 617 | A binding associated with the \fBall\fR tag is invoked first, |
| 618 | followed by one binding for each of the item's tags (in order), |
| 619 | followed by a binding associated with the item's id. |
| 620 | If there are multiple matching bindings for a single tag, |
| 621 | then only the most specific binding is invoked. |
| 622 | A \fBcontinue\fR in a callback terminates that |
| 623 | subroutine, and a \fBbreak\fR method terminates that subroutine |
| 624 | and skips any remaining callbacks for the event, just as for the |
| 625 | \&\fBbind\fR method. |
| 626 | .Sp |
| 627 | If bindings have been created for a canvas window using the \fBCanvasBind\fR |
| 628 | method, then they are invoked in addition to bindings created for |
| 629 | the canvas's items using the \fBbind\fR method. |
| 630 | The bindings for items will be invoked before any of the bindings |
| 631 | for 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?)" |
| 638 | Given a window x\-coordinate in the canvas \fIscreenx\fR, this method returns |
| 639 | the canvas x\-coordinate that is displayed at that location. |
| 640 | If \fIgridspacing\fR is specified, then the canvas coordinate is |
| 641 | rounded 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?)" |
| 644 | Given a window y\-coordinate in the canvas \fIscreeny\fR this method returns |
| 645 | the canvas y\-coordinate that is displayed at that location. |
| 646 | If \fIgridspacing\fR is specified, then the canvas coordinate is |
| 647 | rounded 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 ...?)" |
| 650 | Query or modify the coordinates that define an item. |
| 651 | If no coordinates are specified, this method returns a list |
| 652 | whose elements are the coordinates of the item named by |
| 653 | \&\fItagOrId\fR. |
| 654 | If coordinates are specified, then they replace the current |
| 655 | coordinates for the named item. |
| 656 | If \fItagOrId\fR refers to multiple items, then |
| 657 | the 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, ...?)" |
| 660 | Create a new item in \fI$canvas\fR of type \fItype\fR. |
| 661 | The exact format of the arguments after \fBtype\fR depends |
| 662 | on \fBtype\fR, but usually they consist of the coordinates for |
| 663 | one or more points, followed by specifications for zero or |
| 664 | more item options. |
| 665 | See the subsections on individual item types below for more |
| 666 | on the syntax of this method. |
| 667 | This 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?)" |
| 670 | For each item given by \fItagOrId\fR, delete the characters, or coordinates, |
| 671 | in the range given by \fIfirst\fR and \fIlast\fR, inclusive. |
| 672 | If some of the items given by \fItagOrId\fR don't support |
| 673 | Text items interpret \fIfirst\fR and \fIlast\fR as indices to a character, |
| 674 | line and polygon items interpret them indices to a coordinate (an x,y pair). |
| 675 | within the item(s) as described in \*(L"\s-1INDICES\s0\*(R" above. |
| 676 | If \fIlast\fR is omitted, it defaults to \fIfirst\fR. |
| 677 | This method returns an empty string. |
| 678 | .IP "\fI$canvas\fR\->\fBdelete\fR(?\fItagOrId, tagOrId, ...\fR?)" 4 |
| 679 | .IX Item "$canvas->delete(?tagOrId, tagOrId, ...?)" |
| 680 | Delete each of the items given by each \fItagOrId\fR, and return |
| 681 | an empty string. |
| 682 | .IP "\fI$canvas\fR\->\fBdtag\fR(\fItagOrId, \fR?\fItagToDelete\fR?)" 4 |
| 683 | .IX Item "$canvas->dtag(tagOrId, ?tagToDelete?)" |
| 684 | For each of the items given by \fItagOrId\fR, delete the |
| 685 | tag given by \fItagToDelete\fR from the list of those |
| 686 | associated with the item. |
| 687 | If an item doesn't have the tag \fItagToDelete\fR then |
| 688 | the item is unaffected by the method. |
| 689 | If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR. |
| 690 | This 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, ...?)" |
| 693 | This method returns a list consisting of all the items that |
| 694 | meet the constraints specified by \fIsearchCommand\fR and |
| 695 | \&\fIarg\fR's. |
| 696 | \&\fISearchCommand\fR and \fIargs\fR have any of the forms |
| 697 | accepted by the \fBaddtag\fR method. |
| 698 | The 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 |
| 705 | Set the keyboard focus for the canvas widget to the item given by |
| 706 | \&\fItagOrId\fR. |
| 707 | If \fItagOrId\fR refers to several items, then the focus is set |
| 708 | to the first such item in the display list that supports the |
| 709 | insertion cursor. |
| 710 | If \fItagOrId\fR doesn't refer to any items, or if none of them |
| 711 | support the insertion cursor, then the focus isn't changed. |
| 712 | If \fItagOrId\fR is an empty |
| 713 | string, then the focus item is reset so that no item has the focus. |
| 714 | If \fItagOrId\fR is not specified then the method returns the |
| 715 | id for the item that currently has the focus, or an empty string |
| 716 | if no item has the focus. |
| 717 | .RS 4 |
| 718 | .Sp |
| 719 | .RS 8 |
| 720 | Once the focus has been set to an item, the item will display |
| 721 | the insertion cursor and all keyboard events will be directed |
| 722 | to that item. |
| 723 | The focus item within a canvas and the focus window on the |
| 724 | screen (set with the \fBfocus\fR method) are totally independent: |
| 725 | a given item doesn't actually have the input focus unless (a) |
| 726 | its canvas is the focus window and (b) the item is the focus item |
| 727 | within the canvas. |
| 728 | In most cases it is advisable to follow the \fBfocus\fR widget |
| 729 | method with the \fBCanvasFocus\fR method to set the focus window to |
| 730 | the 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)" |
| 737 | Return a list whose elements are the tags associated with the |
| 738 | item given by \fItagOrId\fR. |
| 739 | If \fItagOrId\fR refers to more than one item, then the tags |
| 740 | are returned from the first such item in the display list. |
| 741 | If \fItagOrId\fR doesn't refer to any items, or if the item |
| 742 | contains 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)" |
| 745 | Set the position of the insertion cursor for the item(s) given by \fItagOrId\fR |
| 746 | to just before the character whose position is given by \fIindex\fR. |
| 747 | If some or all of the items given by \fItagOrId\fR don't support |
| 748 | an insertion cursor then this method has no effect on them. |
| 749 | See \*(L"\s-1INDICES\s0\*(R" above for a description of the |
| 750 | legal forms for \fIindex\fR. |
| 751 | Note: the insertion cursor is only displayed in an item if |
| 752 | that item currently has the keyboard focus (see the widget |
| 753 | method \fBfocus\fR, below), but the cursor position may |
| 754 | be set even when the item doesn't have the focus. |
| 755 | This method returns an empty string. |
| 756 | .IP "\fI$canvas\fR\->\fBindex\fR(\fItagOrId, index\fR)" 4 |
| 757 | .IX Item "$canvas->index(tagOrId, index)" |
| 758 | This method returns a decimal string giving the numerical index |
| 759 | within \fItagOrId\fR corresponding to \fIindex\fR. |
| 760 | \&\fIIndex\fR gives a textual description of the desired position |
| 761 | as described in \*(L"\s-1INDICES\s0\*(R" above. |
| 762 | Text items interpret \fIindex\fR as an index to a character, |
| 763 | line and polygon items interpret it as an index to a coordinate (an x,y pair). |
| 764 | The return value is guaranteed to lie between 0 and the number |
| 765 | of characters, or coordinates, within the item, inclusive. |
| 766 | If \fItagOrId\fR refers to multiple items, then the index |
| 767 | is processed in the first of these items that supports indexing |
| 768 | operations (in display list order). |
| 769 | .IP "\fI$canvas\fR\->\fBinsert\fR(\fItagOrId, beforeThis, string\fR)" 4 |
| 770 | .IX Item "$canvas->insert(tagOrId, beforeThis, string)" |
| 771 | For each of the items given by \fItagOrId\fR, if the item supports |
| 772 | text or coordinate, insertion then \fIstring\fR is inserted into the item's |
| 773 | text just before the character, or coordinate, whose index is \fIbeforeThis\fR. |
| 774 | Text items interpret \fIbeforethis\fR as an index to a character, |
| 775 | line and polygon items interpret it as an index to a coordinate (an x,y pair). |
| 776 | For lines and polygons the \fIstring\fR must be a valid coordinate |
| 777 | sequence. |
| 778 | See \*(L"\s-1INDICES\s0\*(R" above for information about the forms allowed |
| 779 | for \fIbeforeThis\fR. |
| 780 | This method returns an empty string. |
| 781 | .IP "\fI$canvas\fR\->\fBitemcget\fR(\fItagOrId, \fR\fIoption\fR)" 4 |
| 782 | .IX Item "$canvas->itemcget(tagOrId, option)" |
| 783 | Returns the current value of the configuration option for the |
| 784 | item given by \fItagOrId\fR whose name is \fIoption\fR. |
| 785 | This method is similar to the cget method except that |
| 786 | it 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 |
| 788 | method when the item was created. |
| 789 | If \fItagOrId\fR is a tag that refers to more than one item, |
| 790 | the 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, ...?)" |
| 793 | This method is similar to the configure method except |
| 794 | that it modifies item-specific options for the items given by |
| 795 | \&\fItagOrId\fR instead of modifying options for the overall |
| 796 | canvas widget. |
| 797 | If no \fIoption\fR is specified, returns a list describing all of |
| 798 | the available options for the first item given by \fItagOrId\fR |
| 799 | (see Tk::options for |
| 800 | information on the format of this list). If \fIoption\fR is specified |
| 801 | with no \fIvalue\fR, then the method returns a list describing the |
| 802 | one named option (this list will be identical to the corresponding |
| 803 | sublist of the value returned if no \fIoption\fR is specified). If |
| 804 | one or more \fIoption-value\fR pairs are specified, then the method |
| 805 | modifies the given widget option(s) to have the given value(s) in |
| 806 | each of the items given by \fItagOrId\fR; in |
| 807 | this case the method returns an empty string. |
| 808 | The \fIoption\fRs and \fIvalue\fRs are the same as those permissible |
| 809 | in the \fBcreate\fR method when the item(s) were created; |
| 810 | see the sections describing individual item types below for details |
| 811 | on the legal options. |
| 812 | .IP "\fI$canvas\fR\->\fBlower\fR(\fItagOrId, \fR?\fIbelowThis\fR?)" 4 |
| 813 | .IX Item "$canvas->lower(tagOrId, ?belowThis?)" |
| 814 | Move all of the items given by \fItagOrId\fR to a new position |
| 815 | in the display list just before the item given by \fIbelowThis\fR. |
| 816 | If \fItagOrId\fR refers to more than one item then all are moved |
| 817 | but 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 |
| 819 | item then the first (lowest) of these items in the display list is used |
| 820 | as the destination location for the moved items. |
| 821 | Note: this method has no effect on window items. Window items always |
| 822 | obscure other item types, and the stacking order of window items is |
| 823 | determined by the \fBraise\fR and \fBlower\fR methods of the widget, not the |
| 824 | \&\fBraise\fR and \fBlower\fR methods for canvases. |
| 825 | This 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)" |
| 828 | Move each of the items given by \fItagOrId\fR in the canvas coordinate |
| 829 | space by adding \fIxAmount\fR to the x\-coordinate of each point |
| 830 | associated with the item and \fIyAmount\fR to the y\-coordinate of |
| 831 | each point associated with the item. |
| 832 | This 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, ...?)" |
| 835 | Generate a Postscript representation for part or all of the canvas. |
| 836 | If the \fB\-file\fR option is specified then the Postscript is written |
| 837 | to a file and an empty string is returned; otherwise the Postscript |
| 838 | is returned as the result of the method. |
| 839 | If the interpreter that owns the canvas is marked as safe, the operation |
| 840 | will fail because safe interpreters are not allowed to write files. |
| 841 | If the \fB\-channel\fR option is specified, the argument denotes the name |
| 842 | of a channel already opened for writing. The Postscript is written to |
| 843 | that channel, and the channel is left open for further writing at the end |
| 844 | of the operation. |
| 845 | The Postscript is created in Encapsulated Postscript form using |
| 846 | version 3.0 of the Document Structuring Conventions. |
| 847 | Note: by default Postscript is only generated for information that |
| 848 | appears in the canvas's window on the screen. If the canvas is |
| 849 | freshly created it may still have its initial size of 1x1 pixel |
| 850 | so nothing will appear in the Postscript. To get around this problem |
| 851 | either invoke the \fBupdate\fR method to wait for the canvas window |
| 852 | to reach its final size, or else use the \fB\-width\fR and \fB\-height\fR |
| 853 | options to specify the area of the canvas to print. |
| 854 | The \fIoption\fR\-\fIvalue\fR argument pairs provide additional |
| 855 | information to control the generation of Postscript. The following |
| 856 | options 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 |
| 861 | that specifies a color mapping to use in the Postscript. |
| 862 | Each value of the hash must consist of Postscript |
| 863 | code to set a particular color value (e.g. ``\fB1.0 1.0 0.0 setrgbcolor\fR''). |
| 864 | When outputting color information in the Postscript, Tk checks |
| 865 | to see if there is a key in the hash with the same |
| 866 | name as the color. |
| 867 | If so, Tk uses the value of the element as the Postscript method |
| 868 | to set the color. |
| 869 | If this option hasn't been specified, or if there isn't a key |
| 870 | in \fIhashRef\fR for a given color, then Tk uses the red, green, |
| 871 | and blue intensities from the X color. |
| 872 | .IP "\fB\-colormode\fR => \fImode\fR" 8 |
| 873 | .IX Item "-colormode => mode" |
| 874 | Specifies how to output color information. \fIMode\fR must be either |
| 875 | \&\fBcolor\fR (for full color output), \fBgray\fR (convert all colors |
| 876 | to their gray-scale equivalents) or \fBmono\fR (convert all colors |
| 877 | to black or white). |
| 878 | .IP "\fB\-file\fR => \fIfileName\fR" 8 |
| 879 | .IX Item "-file => fileName" |
| 880 | Specifies the name of the file in which to write the Postscript. |
| 881 | If this option isn't specified then the Postscript is returned as the |
| 882 | result 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 |
| 886 | that specifies a font mapping to use in the Postscript. |
| 887 | Each value of the hash must consist of an array reference with |
| 888 | two elements, which are the name and point size of a Postscript font. |
| 889 | When outputting Postscript commands for a particular font, Tk |
| 890 | checks to see if \fIhashRef\fR contains a value with the same |
| 891 | name as the font. |
| 892 | If there is such an element, then the font information contained in |
| 893 | that element is used in the Postscript. |
| 894 | Otherwise Tk attempts to guess what Postscript font to use. |
| 895 | Tk's guesses generally only work for well-known fonts such as |
| 896 | Times and Helvetica and Courier, and only if the X font name does not |
| 897 | omit any dashes up through the point size. |
| 898 | For 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 |
| 900 | parse the font name). |
| 901 | .IP "\fB\-height\fR => \fIsize\fR" 8 |
| 902 | .IX Item "-height => size" |
| 903 | Specifies the height of the area of the canvas to print. |
| 904 | Defaults to the height of the canvas window. |
| 905 | .IP "\fB\-pageanchor\fR => \fIanchor\fR" 8 |
| 906 | .IX Item "-pageanchor => anchor" |
| 907 | Specifies which point of the printed area of the canvas should appear over |
| 908 | the positioning point on the page (which is given by the \fB\-pagex\fR |
| 909 | and \fB\-pagey\fR options). |
| 910 | For example, \fB\-pageanchor\fR=>\fBn\fR means that the top center of the |
| 911 | area of the canvas being printed (as it appears in the canvas window) |
| 912 | should be over the positioning point. Defaults to \fBcenter\fR. |
| 913 | .IP "\fB\-pageheight\fR => \fIsize\fR" 8 |
| 914 | .IX Item "-pageheight => size" |
| 915 | Specifies that the Postscript should be scaled in both x and y so |
| 916 | that 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, |
| 919 | or \fBp\fR or nothing for printer's points (1/72 inch). |
| 920 | Defaults to the height of the printed area on the screen. |
| 921 | If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then |
| 922 | the scale factor from \fB\-pagewidth\fR is used (non\-uniform scaling |
| 923 | is not implemented). |
| 924 | .IP "\fB\-pagewidth\fR => \fIsize\fR" 8 |
| 925 | .IX Item "-pagewidth => size" |
| 926 | Specifies that the Postscript should be scaled in both x and y so |
| 927 | that the printed area is \fIsize\fR wide on the Postscript page. |
| 928 | \&\fISize\fR has the same form as for \fB\-pageheight\fR. |
| 929 | Defaults to the width of the printed area on the screen. |
| 930 | If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then |
| 931 | the scale factor from \fB\-pagewidth\fR is used (non\-uniform scaling |
| 932 | is 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 |
| 936 | the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. |
| 937 | Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options |
| 938 | to determine where the printed area appears on the Postscript page. |
| 939 | Defaults 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 |
| 943 | the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. |
| 944 | Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options |
| 945 | to determine where the printed area appears on the Postscript page. |
| 946 | Defaults 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 |
| 950 | degrees. |
| 951 | In non-rotated output the x\-axis of the printed area runs along |
| 952 | the short dimension of the page (``portrait'' orientation); |
| 953 | in rotated output the x\-axis runs along the long dimension of the |
| 954 | page (``landscape'' orientation). |
| 955 | Defaults to non\-rotated. |
| 956 | .IP "\fB\-width\fR => \fIsize\fR" 8 |
| 957 | .IX Item "-width => size" |
| 958 | Specifies the width of the area of the canvas to print. |
| 959 | Defaults to the width of the canvas window. |
| 960 | .IP "\fB\-x\fR => \fIposition\fR" 8 |
| 961 | .IX Item "-x => position" |
| 962 | Specifies the x\-coordinate of the left edge of the area of the |
| 963 | canvas that is to be printed, in canvas coordinates, not window |
| 964 | coordinates. |
| 965 | Defaults to the coordinate of the left edge of the window. |
| 966 | .IP "\fB\-y\fR => \fIposition\fR" 8 |
| 967 | .IX Item "-y => position" |
| 968 | Specifies the y\-coordinate of the top edge of the area of the |
| 969 | canvas that is to be printed, in canvas coordinates, not window |
| 970 | coordinates. |
| 971 | Defaults 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?)" |
| 977 | Move all of the items given by \fItagOrId\fR to a new position |
| 978 | in the display list just after the item given by \fIaboveThis\fR. |
| 979 | If \fItagOrId\fR refers to more than one item then all are moved |
| 980 | but 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 |
| 982 | item then the last (topmost) of these items in the display list is used |
| 983 | as the destination location for the moved items. |
| 984 | Note: this method has no effect on window items. Window items always |
| 985 | obscure other item types, and the stacking order of window items is |
| 986 | determined by the \fBraise\fR and \fBlower\fR widget commands, not the |
| 987 | \&\fBraise\fR and \fBlower\fR methods for canvases. |
| 988 | This 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)" |
| 991 | Rescale all of the items given by \fItagOrId\fR in canvas coordinate |
| 992 | space. |
| 993 | \&\fIXOrigin\fR and \fIyOrigin\fR identify the origin for the scaling |
| 994 | operation and \fIxScale\fR and \fIyScale\fR identify the scale |
| 995 | factors for x\- and y\-coordinates, respectively (a scale factor of |
| 996 | 1.0 implies no change to that coordinate). |
| 997 | For each of the points defining each item, the x\-coordinate is |
| 998 | adjusted to change the distance from \fIxOrigin\fR by a factor |
| 999 | of \fIxScale\fR. |
| 1000 | Similarly, each y\-coordinate is adjusted to change the distance |
| 1001 | from \fIyOrigin\fR by a factor of \fIyScale\fR. |
| 1002 | This method returns an empty string. |
| 1003 | .IP "\fI$canvas\fR\->\fBscan\fR(\fIoption, args\fR)" 4 |
| 1004 | .IX Item "$canvas->scan(option, args)" |
| 1005 | This method is used to implement scanning on canvases. It has |
| 1006 | two 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)" |
| 1010 | Records \fIx\fR and \fIy\fR and the canvas's current view; used |
| 1011 | in conjunction with later \fBscanDragto\fR method. |
| 1012 | Typically this method is associated with a mouse button press in |
| 1013 | the widget and \fIx\fR and \fIy\fR are the coordinates of the |
| 1014 | mouse. 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?.)" |
| 1017 | This method computes the difference between its \fIx\fR and \fIy\fR |
| 1018 | arguments (which are typically mouse coordinates) and the \fIx\fR and |
| 1019 | \&\fIy\fR arguments to the last \fBscanMark\fR method for the widget. |
| 1020 | It then adjusts the view by 10 times the |
| 1021 | difference in coordinates. This method is typically associated |
| 1022 | It then adjusts the view by \fIgain\fR times the |
| 1023 | difference in coordinates, where \fIgain\fR defaults to 10. |
| 1024 | This command is typically associated |
| 1025 | with mouse motion events in the widget, to produce the effect of |
| 1026 | dragging the canvas at high speed through its window. The return |
| 1027 | value 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?)" |
| 1033 | Manipulates the selection in one of several ways, depending on |
| 1034 | \&\fIoption\fR. |
| 1035 | The method may take any of the forms described below. |
| 1036 | In all of the descriptions below, \fItagOrId\fR must refer to |
| 1037 | an item that supports indexing and selection; if it refers to |
| 1038 | multiple items then the first of |
| 1039 | these that supports indexing and the selection is used. |
| 1040 | \&\fIIndex\fR gives a textual description of a position |
| 1041 | within \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)" |
| 1045 | Locate the end of the selection in \fItagOrId\fR nearest |
| 1046 | to the character given by \fIindex\fR, and adjust that |
| 1047 | end of the selection to be at \fIindex\fR (i.e. including |
| 1048 | but not going beyond \fIindex\fR). |
| 1049 | The other end of the selection is made the anchor point |
| 1050 | for future \fBselectTo\fR method calls. |
| 1051 | If the selection isn't currently in \fItagOrId\fR then |
| 1052 | this method behaves the same as the \fBselectTo\fR widget |
| 1053 | method. |
| 1054 | Returns an empty string. |
| 1055 | .IP "\fI$canvas\fR\->\fBselectClear\fR" 8 |
| 1056 | .IX Item "$canvas->selectClear" |
| 1057 | Clear the selection if it is in this widget. |
| 1058 | If the selection isn't in this widget then the method |
| 1059 | has no effect. |
| 1060 | Returns an empty string. |
| 1061 | .IP "\fI$canvas\fR\->\fBselectFrom\fR(\fItagOrId, index\fR)" 8 |
| 1062 | .IX Item "$canvas->selectFrom(tagOrId, index)" |
| 1063 | Set the selection anchor point for the widget to be just |
| 1064 | before the character |
| 1065 | given by \fIindex\fR in the item given by \fItagOrId\fR. |
| 1066 | This method doesn't change the selection; it just sets |
| 1067 | the fixed end of the selection for future \fBselectTo\fR |
| 1068 | method calls. |
| 1069 | Returns an empty string. |
| 1070 | .IP "\fI$canvas\fR\->\fBselectItem\fR" 8 |
| 1071 | .IX Item "$canvas->selectItem" |
| 1072 | Returns the id of the selected item, if the selection is in an |
| 1073 | item in this canvas. |
| 1074 | If the selection is not in this canvas then an empty string |
| 1075 | is returned. |
| 1076 | .IP "\fI$canvas\fR\->\fBselectTo\fR(\fItagOrId, index\fR)" 8 |
| 1077 | .IX Item "$canvas->selectTo(tagOrId, index)" |
| 1078 | Set the selection to consist of those characters of \fItagOrId\fR |
| 1079 | between the selection anchor point and |
| 1080 | \&\fIindex\fR. |
| 1081 | The new selection will include the character given by \fIindex\fR; |
| 1082 | it will include the character given by the anchor point only if |
| 1083 | \&\fIindex\fR is greater than or equal to the anchor point. |
| 1084 | The anchor point is determined by the most recent \fBselectAdjust\fR |
| 1085 | or \fBselectFrom\fR method calls for this widget. |
| 1086 | If the selection anchor point for the widget isn't currently in |
| 1087 | \&\fItagOrId\fR, then it is set to the same character given |
| 1088 | by \fIindex\fR. |
| 1089 | Returns 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)" |
| 1095 | Returns the type of the item given by \fItagOrId\fR, such as |
| 1096 | \&\fBrectangle\fR or \fBtext\fR. |
| 1097 | If \fItagOrId\fR refers to more than one item, then the type |
| 1098 | of the first item in the display list is returned. |
| 1099 | If \fItagOrId\fR doesn't refer to any items at all then |
| 1100 | an empty string is returned. |
| 1101 | .IP "\fI$canvas\fR\->\fBxview\fR(?\fIargs\fR?)" 4 |
| 1102 | .IX Item "$canvas->xview(?args?)" |
| 1103 | This method is used to query and change the horizontal position of the |
| 1104 | information displayed in the canvas's window. |
| 1105 | It can take any of the following forms: |
| 1106 | .RS 4 |
| 1107 | .IP "\fI$canvas\fR\->\fBxview\fR" 8 |
| 1108 | .IX Item "$canvas->xview" |
| 1109 | Returns a list containing two elements. |
| 1110 | Each element is a real fraction between 0 and 1; together they describe |
| 1111 | the horizontal span that is visible in the window. |
| 1112 | For example, if the first element is .2 and the second element is .6, |
| 1113 | 20% of the canvas's area (as defined by the \fB\-scrollregion\fR option) |
| 1114 | is off-screen to the left, the middle 40% is visible |
| 1115 | in the window, and 40% of the canvas is off-screen to the right. |
| 1116 | These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR |
| 1117 | option. |
| 1118 | .IP "\fI$canvas\fR\->\fBxviewMoveto\fR(\fIfraction\fR)" 8 |
| 1119 | .IX Item "$canvas->xviewMoveto(fraction)" |
| 1120 | Adjusts the view in the window so that \fIfraction\fR of the |
| 1121 | total 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)" |
| 1125 | This 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 |
| 1129 | of one of these. |
| 1130 | If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units |
| 1131 | of the \fBxScrollIncrement\fR option, if it is greater than zero, |
| 1132 | or in units of one-tenth the window's width otherwise. |
| 1133 | If \fIwhat is \fR\fBpages\fR then the view |
| 1134 | adjusts in units of nine-tenths the window's width. |
| 1135 | If \fInumber\fR is negative then information farther to the left |
| 1136 | becomes visible; if it is positive then information farther to the right |
| 1137 | becomes 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?)" |
| 1143 | This method is used to query and change the vertical position of the |
| 1144 | information displayed in the canvas's window. |
| 1145 | It can take any of the following forms: |
| 1146 | .RS 4 |
| 1147 | .IP "\fI$canvas\fR\->\fByview\fR" 8 |
| 1148 | .IX Item "$canvas->yview" |
| 1149 | Returns a list containing two elements. |
| 1150 | Each element is a real fraction between 0 and 1; together they describe |
| 1151 | the vertical span that is visible in the window. |
| 1152 | For example, if the first element is .6 and the second element is 1.0, |
| 1153 | the lowest 40% of the canvas's area (as defined by the \fB\-scrollregion\fR |
| 1154 | option) is visible in the window. |
| 1155 | These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR |
| 1156 | option. |
| 1157 | .IP "\fI$canvas\fR\->\fByviewMoveto\fR(\fIfraction\fR)" 8 |
| 1158 | .IX Item "$canvas->yviewMoveto(fraction)" |
| 1159 | Adjusts the view in the window so that \fIfraction\fR of the canvas's |
| 1160 | area 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)" |
| 1164 | This 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. |
| 1168 | If \fIwhat\fR is \fBunits\fR, the view adjusts up or down in units |
| 1169 | of the \fByScrollIncrement\fR option, if it is greater than zero, |
| 1170 | or in units of one-tenth the window's height otherwise. |
| 1171 | If \fIwhat\fR is \fBpages\fR then |
| 1172 | the view adjusts in units of nine-tenths the window's height. |
| 1173 | If \fInumber\fR is negative then higher information becomes |
| 1174 | visible; if it is positive then lower information |
| 1175 | becomes visible. |
| 1176 | .RE |
| 1177 | .RS 4 |
| 1178 | .RE |
| 1179 | .SH "OVERVIEW OF ITEM TYPES" |
| 1180 | .IX Header "OVERVIEW OF ITEM TYPES" |
| 1181 | The sections below describe the various types of items supported |
| 1182 | by canvas widgets. Each item type is characterized by two things: |
| 1183 | first, the form of the \fBcreate\fR method used to create |
| 1184 | instances of the type; and second, a set of configuration options |
| 1185 | for items of that type, which may be used in the |
| 1186 | \&\fBcreate\fR and \fBitemconfigure\fR methods. |
| 1187 | Most items don't support indexing or selection or the methods |
| 1188 | related to them, such as \fBindex\fR and \fBinsert\fR. |
| 1189 | Where items do support these facilities, it is noted explicitly |
| 1190 | in the descriptions below. |
| 1191 | At present, text, line and polygon items provide this support. |
| 1192 | For lines and polygons the indexing facility is used to manipulate |
| 1193 | the coordinates of the item. |
| 1194 | .SH "ARC ITEMS" |
| 1195 | .IX Header "ARC ITEMS" |
| 1196 | Items of type \fBarc\fR appear on the display as arc-shaped regions. |
| 1197 | An arc is a section of an oval delimited by two angles (specified |
| 1198 | by the \fB\-start\fR and \fB\-extent\fR options) and displayed in |
| 1199 | one of several ways (specified by the \fB\-style\fR option). |
| 1200 | Arcs 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 |
| 1206 | The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give |
| 1207 | the coordinates of two diagonally opposite corners of a |
| 1208 | rectangular region enclosing the oval that defines the arc. |
| 1209 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1210 | pairs, each of which sets one of the configuration options |
| 1211 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1212 | used in \fBitemconfigure\fR methods to change the item's |
| 1213 | configuration. |
| 1214 | The 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 |
| 1223 | This option specifies dash patterns for the normal state, the active |
| 1224 | state, and the disabled state of an arc item. |
| 1225 | \&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. |
| 1226 | If 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" |
| 1229 | The 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" |
| 1234 | Specifies the size of the angular range occupied by the arc. |
| 1235 | The arc's range extends for \fIdegrees\fR degrees counter-clockwise |
| 1236 | from the starting angle given by the \fB\-start\fR option. |
| 1237 | \&\fIDegrees\fR may be negative. |
| 1238 | If it is greater than 360 or less than \-360, then \fIdegrees\fR |
| 1239 | modulo 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 |
| 1248 | Specifies the color to be used to fill the arc region in its normal, active, and |
| 1249 | disabled states, |
| 1250 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1251 | If \fIcolor\fR is an empty string (the default), then |
| 1252 | then 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 |
| 1261 | This option specifies the color that should be used to draw the |
| 1262 | outline of the arc in its normal, active and disabled states. |
| 1263 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1264 | This option defaults to \fBblack\fR. If \fIcolor\fR is specified |
| 1265 | as 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 |
| 1274 | This option specifies stipple patterns that should be used to draw the |
| 1275 | outline of the arc in its normal, active and disabled states. |
| 1276 | Indicates 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 |
| 1278 | forms accepted by \fBTk_GetBitmap\fR. |
| 1279 | If the \fB\-outline\fR option hasn't been specified then this option |
| 1280 | has no effect. |
| 1281 | If \fIbitmap\fR is an empty string (the default), then the outline is drawn |
| 1282 | in a solid fashion. |
| 1283 | .IP "\fB\-start\fR => \fIdegrees\fR" 4 |
| 1284 | .IX Item "-start => degrees" |
| 1285 | Specifies the beginning of the angular range occupied by the |
| 1286 | arc. |
| 1287 | \&\fIDegrees\fR is given in units of degrees measured counter-clockwise |
| 1288 | from 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" |
| 1291 | Modifies the state of the arc item where \fIstate\fR may be set to one of: |
| 1292 | normal, disabled, hidden or "\*(L". If set to empty, the state of the canvas |
| 1293 | itself is used. An arc item may also be in the \*(R"active" |
| 1294 | state if the mouse is currently over it. Many options can take |
| 1295 | separate specifications in normal, active and disabled states such that the |
| 1296 | appearance 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 |
| 1305 | This option specifies stipple patterns that should be used to fill the |
| 1306 | the arc in its normal, active and disabled states. |
| 1307 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1308 | forms accepted by \fBTk_GetBitmap\fR. |
| 1309 | If the \fB\-fill\fR option hasn't been specified then this option |
| 1310 | has no effect. |
| 1311 | If \fIbitmap\fR is an empty string (the default), then filling is done |
| 1312 | in a solid fashion. |
| 1313 | .IP "\fB\-style\fR => \fItype\fR" 4 |
| 1314 | .IX Item "-style => type" |
| 1315 | Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR |
| 1316 | (the default) then the arc's region is defined by a section |
| 1317 | of the oval's perimeter plus two line segments, one between the center |
| 1318 | of the oval and each end of the perimeter section. |
| 1319 | If \fItype\fR is \fBchord\fR then the arc's region is defined |
| 1320 | by a section of the oval's perimeter plus a single line segment |
| 1321 | connecting the two end points of the perimeter section. |
| 1322 | If \fItype\fR is \fBarc\fR then the arc's region consists of |
| 1323 | a section of the perimeter alone. |
| 1324 | In this last case the \fB\-fill\fR option is ignored. |
| 1325 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 1326 | .IX Item "-tags => tagList" |
| 1327 | Specifies a set of tags to apply to the item. |
| 1328 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 1329 | existing 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" |
| 1333 | Specifies a callback that is to be executed every time |
| 1334 | the 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 |
| 1343 | Specifies the width of the outline to be drawn around |
| 1344 | the arc's region, in its normal, active and disabled states. |
| 1345 | \&\fIoutlineWidth\fR may be in any of the forms described in |
| 1346 | the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 1347 | If the \fB\-outline\fR option has been specified as undef |
| 1348 | then this option has no effect. |
| 1349 | Wide outlines will be drawn centered on the edges of the arc's region. |
| 1350 | This option defaults to 1.0. |
| 1351 | .SH "BITMAP ITEMS" |
| 1352 | .IX Header "BITMAP ITEMS" |
| 1353 | Items of type \fBbitmap\fR appear on the display as images with |
| 1354 | two colors, foreground and background. |
| 1355 | Bitmaps 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 |
| 1361 | The arguments \fIx\fR and \fIy\fR specify the coordinates of a |
| 1362 | point used to position the bitmap on the display (see the \fB\-anchor\fR |
| 1363 | option below for more information on how bitmaps are displayed). |
| 1364 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1365 | pairs, each of which sets one of the configuration options |
| 1366 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1367 | used in \fBitemconfigure\fR methods to change the item's |
| 1368 | configuration. |
| 1369 | The 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 |
| 1373 | positioning point for the item; it may have any of the forms |
| 1374 | accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR |
| 1375 | is \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 |
| 1377 | its top center point is at the positioning point. |
| 1378 | This 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 |
| 1387 | Specifies the color to use for each of the bitmap's '0' valued pixels |
| 1388 | in its normal, active and disabled states. |
| 1389 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1390 | If this option isn't specified, or if it is specified as undef, |
| 1391 | then nothing is displayed where the bitmap pixels are 0; this |
| 1392 | produces 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 |
| 1401 | Specifies the bitmaps to display in the item in its normal, active and |
| 1402 | disabled 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 |
| 1412 | Specifies the color to use for each of the bitmap's '1' valued pixels |
| 1413 | in its normal, active and disabled states. |
| 1414 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR and |
| 1415 | defaults to \fBblack\fR. |
| 1416 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 1417 | .IX Item "-state => state" |
| 1418 | Modifies the state of the bitmap item where \fIstate\fR may be set to one of: |
| 1419 | normal, disabled, or hidden. An bitmap item may also be in the \*(L"active\*(R" |
| 1420 | state if the mouse is currently over it. Many options can take |
| 1421 | separate specifications in normal, active and disabled states such that the |
| 1422 | appearance of the item can be different in each state. |
| 1423 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 1424 | .IX Item "-tags => tagList" |
| 1425 | Specifies a set of tags to apply to the item. |
| 1426 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 1427 | existing 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" |
| 1431 | Specifies a callback that is to be executed every time |
| 1432 | the bitmap item is updated on the screen. |
| 1433 | .SH "GRID ITEMS" |
| 1434 | .IX Header "GRID ITEMS" |
| 1435 | Items of type \fBgrid\fR are intended for producing a visual reference for |
| 1436 | interpreting other items. They can be drawn as either lines (with dash |
| 1437 | style) or as rectangular \*(L"dots\*(R" at each grid point. |
| 1438 | .PP |
| 1439 | Items of type \fBgrid\fR are unlike other items they always cover the |
| 1440 | whole of the canvas, but are never enclosed by nor overlap any area |
| 1441 | and are not near any point. That is they are intended to be always visible |
| 1442 | but not \*(L"pickable\*(R", as such they do support the \*(L"active\*(R" state. |
| 1443 | They are like other items in that: multiple |
| 1444 | grids are permitted, they can be raised and lowered relative to other |
| 1445 | items, they can be moved and scaled. As yet grids do not apear in |
| 1446 | PostScript output. |
| 1447 | .PP |
| 1448 | Grids have outline like configure options. Grids are created with methods of the |
| 1449 | following form: |
| 1450 | .PP |
| 1451 | .Vb 1 |
| 1452 | \& $canvas->createGrid(x1, y1, x2, y2, ?option, value, option, value, ...?) |
| 1453 | .Ve |
| 1454 | .PP |
| 1455 | The arguments \fIx1\fR, \fIy1\fR give the origin of the grid. \fIx2\fR, and \fIy2\fR give |
| 1456 | the coordinates of the next grid point in their respective directions. |
| 1457 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1458 | pairs, each of which sets one of the configuration options |
| 1459 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1460 | used in \fBitemconfigure\fR methods to change the item's |
| 1461 | configuration. |
| 1462 | The following options are supported for grids: |
| 1463 | .IP "\fB\-lines\fR => \fIboolean\fR" 4 |
| 1464 | .IX Item "-lines => boolean" |
| 1465 | If \fB\-lines\fR is set to a true value then lines are drawn for both X and Y |
| 1466 | grids in the style determined by \fB\-dash\fR. Otherwise retangular \*(L"dots\*(R" |
| 1467 | are 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 |
| 1474 | This option specifies dash patterns for the normal state, |
| 1475 | and the disabled state of a grid item. |
| 1476 | \&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. |
| 1477 | If 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" |
| 1480 | The 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 |
| 1489 | This option specifies the color that should be used to draw the |
| 1490 | outline of the grid in its normal and disabled states. |
| 1491 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1492 | This option defaults to \fBblack\fR. |
| 1493 | If \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 |
| 1500 | This option specifies stipple patterns that should be used to draw the |
| 1501 | outline of the rectangle in its normal and disabled states. |
| 1502 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1503 | forms accepted by \fBTk_GetBitmap\fR. |
| 1504 | If \fIbitmap\fR is an empty string (the default), then the outline is drawn |
| 1505 | in a solid fashion. |
| 1506 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 1507 | .IX Item "-state => state" |
| 1508 | Modifies the state of the rectangle item where \fIstate\fR may be set to one of: |
| 1509 | normal, disabled, or hidden. Many options can take |
| 1510 | separate specifications in normal and disabled states such that the |
| 1511 | appearance of the item can be different in each state. |
| 1512 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 1513 | .IX Item "-tags => tagList" |
| 1514 | Specifies a set of tags to apply to the item. |
| 1515 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 1516 | existing 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" |
| 1520 | Specifies a callback that is to be executed every time |
| 1521 | the 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 |
| 1528 | Specifies the width of the lines drawn by the grid or the size (in both X and Y) |
| 1529 | of the dots, in its normal and disabled states. |
| 1530 | This option defaults to 1.0. |
| 1531 | .SH "IMAGE ITEMS" |
| 1532 | .IX Header "IMAGE ITEMS" |
| 1533 | Items of type \fBimage\fR are used to display images on a |
| 1534 | canvas. |
| 1535 | Images 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 |
| 1541 | The arguments \fIx\fR and \fIy\fR specify the coordinates of a |
| 1542 | point used to position the image on the display (see the \fB\-anchor\fR |
| 1543 | option below for more information). |
| 1544 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1545 | pairs, each of which sets one of the configuration options |
| 1546 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1547 | used in \fBitemconfigure\fR methods to change the item's |
| 1548 | configuration. |
| 1549 | The 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 |
| 1553 | positioning point for the item; it may have any of the forms |
| 1554 | accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR |
| 1555 | is \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 |
| 1557 | its top center point is at the positioning point. |
| 1558 | This 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 |
| 1567 | Specifies the name of the images to display in the item in is normal, |
| 1568 | active and disabled states. |
| 1569 | This 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" |
| 1573 | Modifies the state of the image item where \fIstate\fR may be set to one of: |
| 1574 | normal, disabled, or hidden. An image item may also be in the \*(L"active\*(R" |
| 1575 | state if the mouse is currently over it. Many options can take |
| 1576 | separate specifications in normal, active and disabled states such that the |
| 1577 | appearance of the item can be different in each state. |
| 1578 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 1579 | .IX Item "-tags => tagList" |
| 1580 | Specifies a set of tags to apply to the item. |
| 1581 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 1582 | existing tags for the item; it may be an empty list. |
| 1583 | .IP "\fB\-updatecommand\fR => \fIcommand\fR" 4 |
| 1584 | .IX Item "-updatecommand => command" |
| 1585 | Specifies a callback that is to be executed every time |
| 1586 | the image item is updated on the screen. |
| 1587 | .SH "LINE ITEMS" |
| 1588 | .IX Header "LINE ITEMS" |
| 1589 | Items of type \fBline\fR appear on the display as one or more connected |
| 1590 | line segments or curves. |
| 1591 | Line items support coordinate indexing operations using the canvas |
| 1592 | methods: \fBdchars, index, insert.\fR |
| 1593 | Lines 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 |
| 1599 | The arguments \fIx1\fR through \fIyn\fR give |
| 1600 | the coordinates for a series of two or more points that describe |
| 1601 | a series of connected line segments. |
| 1602 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1603 | pairs, each of which sets one of the configuration options |
| 1604 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1605 | used in \fBitemconfigure\fR methods to change the item's |
| 1606 | configuration. |
| 1607 | The following options are supported for lines: |
| 1608 | .IP "\fB\-arrow\fR => \fIwhere\fR" 4 |
| 1609 | .IX Item "-arrow => where" |
| 1610 | Indicates whether or not arrowheads are to be drawn at one or both |
| 1611 | ends 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). |
| 1616 | This option defaults to \fBnone\fR. |
| 1617 | .IP "\fB\-arrowshape\fR => \fIshape\fR" 4 |
| 1618 | .IX Item "-arrowshape => shape" |
| 1619 | This option indicates how to draw arrowheads. |
| 1620 | The \fIshape\fR argument must be a list with three elements, each |
| 1621 | specifying a distance in any of the forms described in |
| 1622 | the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 1623 | The first element of the list gives the distance along the line |
| 1624 | from the neck of the arrowhead to its tip. |
| 1625 | The second element gives the distance along the line from the |
| 1626 | trailing points of the arrowhead to the tip, and the third |
| 1627 | element gives the distance from the outside edge of the line to the |
| 1628 | trailing points. |
| 1629 | If this option isn't specified then Tk picks a ``reasonable'' shape. |
| 1630 | .IP "\fB\-capstyle\fR => \fIstyle\fR" 4 |
| 1631 | .IX Item "-capstyle => style" |
| 1632 | Specifies the ways in which caps are to be drawn at the endpoints |
| 1633 | of the line. |
| 1634 | \&\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR |
| 1635 | (\fBbutt\fR, \fBprojecting\fR, or \fBround\fR). |
| 1636 | If this option isn't specified then it defaults to \fBbutt\fR. |
| 1637 | Where 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 |
| 1646 | This option specifies dash patterns for the normal state, the active |
| 1647 | state, and the disabled state of a line item. |
| 1648 | \&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. |
| 1649 | If 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" |
| 1652 | The 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 |
| 1663 | Specifies the color to be used to fill the line in its normal, active, and |
| 1664 | disabled states. |
| 1665 | \&\fIColor\fR may have |
| 1666 | any of the forms acceptable to \fBTk_GetColor\fR. It may also be undef, |
| 1667 | in which case the line will be transparent. |
| 1668 | This option defaults to \fBblack\fR. |
| 1669 | .IP "\fB\-joinstyle\fR => \fIstyle\fR" 4 |
| 1670 | .IX Item "-joinstyle => style" |
| 1671 | Specifies the ways in which joints are to be drawn at the vertices |
| 1672 | of the line. |
| 1673 | \&\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR |
| 1674 | (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). |
| 1675 | If this option isn't specified then it defaults to \fBmiter\fR. |
| 1676 | If the line only contains two points then this option is |
| 1677 | irrelevant. |
| 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. |
| 1681 | It indicates whether or not the line should be drawn as a curve. |
| 1682 | If so, the line is rendered as a set of parabolic splines: one spline |
| 1683 | is drawn for the first and second line segments, one for the second |
| 1684 | and third, and so on. Straight-line segments can be generated within |
| 1685 | a curve by duplicating the end-points of the desired line segment. |
| 1686 | .IP "\fB\-splinesteps\fR => \fInumber\fR" 4 |
| 1687 | .IX Item "-splinesteps => number" |
| 1688 | Specifies the degree of smoothness desired for curves: each spline |
| 1689 | will be approximated with \fInumber\fR line segments. This |
| 1690 | option is ignored unless the \fB\-smooth\fR option is true. |
| 1691 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 1692 | .IX Item "-state => state" |
| 1693 | Modifies the state of the line item where \fIstate\fR may be set to one of: |
| 1694 | normal, disabled, or hidden. A line item may also be in the \*(L"active\*(R" |
| 1695 | state if the mouse is currently over it. Many options can take |
| 1696 | separate specifications in normal, active and disabled states such that the |
| 1697 | appearance 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 |
| 1706 | This option specifies stipple patterns that should be used to fill the |
| 1707 | the line in its normal, active and disabled states. |
| 1708 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1709 | forms accepted by \fBTk_GetBitmap\fR. |
| 1710 | If \fIbitmap\fR is an empty string (the default), then filling is |
| 1711 | done in a solid fashion. |
| 1712 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 1713 | .IX Item "-tags => tagList" |
| 1714 | Specifies a set of tags to apply to the item. |
| 1715 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 1716 | existing 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" |
| 1720 | Specifies a callback that is to be executed every time |
| 1721 | the 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 |
| 1730 | Specifies the width of the line |
| 1731 | in its normal, active and disabled states. |
| 1732 | \&\fIlineWidth\fR may be in any of the forms |
| 1733 | described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 1734 | .Sp |
| 1735 | Wide lines will be drawn centered on the path specified by the |
| 1736 | points. |
| 1737 | If this option isn't specified then it defaults to 1.0. |
| 1738 | .SH "OVAL ITEMS" |
| 1739 | .IX Header "OVAL ITEMS" |
| 1740 | Items of type \fBoval\fR appear as circular or oval regions on |
| 1741 | the display. Each oval may have an outline, a fill, or |
| 1742 | both. Ovals are created with methods of the |
| 1743 | following form: |
| 1744 | .PP |
| 1745 | .Vb 1 |
| 1746 | \& $canvas->createOval(x1, y1, x2, y2, ?option, value, option, value, ...?) |
| 1747 | .Ve |
| 1748 | .PP |
| 1749 | The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give |
| 1750 | the coordinates of two diagonally opposite corners of a |
| 1751 | rectangular region enclosing the oval. |
| 1752 | The oval will include the top and left edges of the rectangle |
| 1753 | not the lower or right edges. |
| 1754 | If the region is square then the resulting oval is circular; |
| 1755 | otherwise it is elongated in shape. |
| 1756 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1757 | pairs, each of which sets one of the configuration options |
| 1758 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1759 | used in \fBitemconfigure\fR methods to change the item's |
| 1760 | configuration. |
| 1761 | The 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 |
| 1770 | This option specifies dash patterns for the normal state, the active |
| 1771 | state, and the disabled state of an oval item. |
| 1772 | \&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. |
| 1773 | If 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" |
| 1776 | The 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 |
| 1787 | Specifies the color to be used to fill the oval in its normal, active, and |
| 1788 | disabled states. |
| 1789 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1790 | If \fIcolor\fR is undef (the default), then |
| 1791 | then 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 |
| 1800 | This option specifies the color that should be used to draw the |
| 1801 | outline of the oval in its normal, active and disabled states. |
| 1802 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1803 | This option defaults to \fBblack\fR. |
| 1804 | If \fIcolor\fR is undef then no outline will be |
| 1805 | drawn 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 |
| 1814 | This option specifies stipple patterns that should be used to draw the |
| 1815 | outline of the oval in its normal, active and disabled states. |
| 1816 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1817 | forms accepted by \fBTk_GetBitmap\fR. |
| 1818 | If the \fB\-outline\fR option hasn't been specified then this option |
| 1819 | has no effect. |
| 1820 | If \fIbitmap\fR is an empty string (the default), then the outline is drawn |
| 1821 | in a solid fashion. |
| 1822 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 1823 | .IX Item "-state => state" |
| 1824 | Modifies the state of the oval item where \fIstate\fR may be set to one of: |
| 1825 | normal, disabled, or hidden. An oval item may also be in the \*(L"active\*(R" |
| 1826 | state if the mouse is currently over it. Many options can take |
| 1827 | separate specifications in normal, active and disabled states such that the |
| 1828 | appearance 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 |
| 1837 | This option specifies stipple patterns that should be used to fill the |
| 1838 | the oval in its normal, active and disabled states. |
| 1839 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1840 | forms accepted by \fBTk_GetBitmap\fR. |
| 1841 | If the \fB\-fill\fR option hasn't been specified then this option |
| 1842 | has no effect. |
| 1843 | If \fIbitmap\fR is an empty string (the default), then filling is done |
| 1844 | in a solid fashion. |
| 1845 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 1846 | .IX Item "-tags => tagList" |
| 1847 | Specifies a set of tags to apply to the item. |
| 1848 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 1849 | existing 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" |
| 1853 | Specifies a callback that is to be executed every time |
| 1854 | the 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 |
| 1863 | Specifies the width of the outline to be drawn around |
| 1864 | the oval, in its normal, active and disabled states. |
| 1865 | \&\fIoutlineWidth\fR specifies the width of the outline to be drawn around |
| 1866 | the oval, in any of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 1867 | .Sp |
| 1868 | If the \fB\-outline\fR option hasn't been specified then this option |
| 1869 | has no effect. |
| 1870 | Wide outlines are drawn centered on the oval path defined by |
| 1871 | \&\fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. |
| 1872 | This option defaults to 1.0. |
| 1873 | .SH "POLYGON ITEMS" |
| 1874 | .IX Header "POLYGON ITEMS" |
| 1875 | Items of type \fBpolygon\fR appear as polygonal or curved filled regions |
| 1876 | on the display. |
| 1877 | Polygon items support coordinate indexing operations using the canvas |
| 1878 | methods: \fBdchars, index, insert.\fR |
| 1879 | Polygons 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 |
| 1885 | The arguments \fIx1\fR through \fIyn\fR specify the coordinates for |
| 1886 | three or more points that define a closed polygon. |
| 1887 | The first and last points may be the same; whether they are or not, |
| 1888 | Tk will draw the polygon as a closed polygon. |
| 1889 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 1890 | pairs, each of which sets one of the configuration options |
| 1891 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 1892 | used in \fBitemconfigure\fR methods to change the item's |
| 1893 | configuration. |
| 1894 | The 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 |
| 1903 | This option specifies dash patterns for the normal state, the active |
| 1904 | state, and the disabled state of an polygon item. |
| 1905 | \&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. |
| 1906 | If 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" |
| 1909 | The 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 |
| 1920 | Specifies the color to be used to fill the polygon in its normal, active, and |
| 1921 | disabled states. |
| 1922 | \&\fIColor\fR |
| 1923 | may have any of the forms acceptable to \fBTk_GetColor\fR. |
| 1924 | If \fIcolor\fR is undef then the polygon will be |
| 1925 | transparent. |
| 1926 | This option defaults to \fBblack\fR. |
| 1927 | .IP "\fB\-joinstyle\fR => \fIstyle\fR" 4 |
| 1928 | .IX Item "-joinstyle => style" |
| 1929 | Specifies the ways in which joints are to be drawn at the vertices |
| 1930 | of the outline. |
| 1931 | \&\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR |
| 1932 | (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). |
| 1933 | If 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 |
| 1942 | This option specifies the color that should be used to draw the |
| 1943 | outline of the polygon in its normal, active and disabled states. |
| 1944 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 1945 | If \fIcolor\fR is undef then no outline will be |
| 1946 | drawn for the polygon. |
| 1947 | This 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 |
| 1956 | This option specifies stipple patterns that should be used to draw the |
| 1957 | outline of the polygon in its normal, active and disabled states. |
| 1958 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1959 | forms accepted by \fBTk_GetBitmap\fR. |
| 1960 | If the \fB\-outline\fR option hasn't been specified then this option |
| 1961 | has no effect. |
| 1962 | If \fIbitmap\fR is an empty string (the default), then the outline is drawn |
| 1963 | in 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 |
| 1967 | It indicates whether or not the polygon should be drawn with a |
| 1968 | curved perimeter. |
| 1969 | If so, the outline of the polygon becomes a set of parabolic splines, |
| 1970 | one spline for the first and second line segments, one for the second |
| 1971 | and third, and so on. Straight-line segments can be generated in a |
| 1972 | smoothed polygon by duplicating the end-points of the desired line segment. |
| 1973 | .IP "\fB\-splinesteps\fR => \fInumber\fR" 4 |
| 1974 | .IX Item "-splinesteps => number" |
| 1975 | Specifies the degree of smoothness desired for curves: each spline |
| 1976 | will be approximated with \fInumber\fR line segments. This |
| 1977 | option is ignored unless the \fB\-smooth\fR option is true. |
| 1978 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 1979 | .IX Item "-state => state" |
| 1980 | Modifies the state of the polygon item where \fIstate\fR may be set to one of: |
| 1981 | normal, disabled, or hidden. A polygon item may also be in the \*(L"active\*(R" |
| 1982 | state if the mouse is currently over it. Many options can take |
| 1983 | separate specifications in normal, active and disabled states such that the |
| 1984 | appearance 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 |
| 1993 | This option specifies stipple patterns that should be used to fill the |
| 1994 | the polygon in its normal, active and disabled states. |
| 1995 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 1996 | forms accepted by \fBTk_GetBitmap\fR. |
| 1997 | If \fIbitmap\fR is an empty string (the default), then filling is |
| 1998 | done in a solid fashion. |
| 1999 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 2000 | .IX Item "-tags => tagList" |
| 2001 | Specifies a set of tags to apply to the item. |
| 2002 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 2003 | existing 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" |
| 2007 | Specifies a callback that is to be executed every time |
| 2008 | the 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 |
| 2019 | the polygon, in its normal, active and disabled states. |
| 2020 | \&\fIoutlineWidth\fR may be in any of the forms described in the \s-1COORDINATES\s0 |
| 2021 | section above. |
| 2022 | \&\fIOutlineWidth\fR specifies the width of the outline to be drawn around |
| 2023 | the polygon, in any of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 2024 | If the \fB\-outline\fR option hasn't been specified then this option |
| 2025 | has no effect. This option defaults to 1.0. |
| 2026 | .Sp |
| 2027 | Polygon items are different from other items such as rectangles, ovals |
| 2028 | and arcs in that interior points are considered to be ``inside'' a |
| 2029 | polygon (e.g. for purposes of the \fBfind closest\fR and |
| 2030 | \&\fBfind overlapping\fR methods) even if it is not filled. |
| 2031 | For most other item types, an |
| 2032 | interior point is considered to be inside the item only if the item |
| 2033 | is filled or if it has neither a fill nor an outline. If you would |
| 2034 | like an unfilled polygon whose interior points are not considered |
| 2035 | to be inside the polygon, use a line item instead. |
| 2036 | .SH "RECTANGLE ITEMS" |
| 2037 | .IX Header "RECTANGLE ITEMS" |
| 2038 | Items of type \fBrectangle\fR appear as rectangular regions on |
| 2039 | the display. Each rectangle may have an outline, a fill, or |
| 2040 | both. Rectangles are created with methods of the |
| 2041 | following form: |
| 2042 | .PP |
| 2043 | .Vb 1 |
| 2044 | \& $canvas->createRectangle(x1, y1, x2, y2, ?option, value, option, value, ...?) |
| 2045 | .Ve |
| 2046 | .PP |
| 2047 | The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give |
| 2048 | the coordinates of two diagonally opposite corners of the rectangle |
| 2049 | (the rectangle will include its upper and left edges but not |
| 2050 | its lower or right edges). |
| 2051 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 2052 | pairs, each of which sets one of the configuration options |
| 2053 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 2054 | used in \fBitemconfigure\fR methods to change the item's |
| 2055 | configuration. |
| 2056 | The 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 |
| 2065 | This option specifies dash patterns for the normal state, the active |
| 2066 | state, and the disabled state of a rectangle item. |
| 2067 | \&\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. |
| 2068 | If 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" |
| 2071 | The 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 |
| 2082 | Specifies the color to be used to fill the rectangle in its normal, active, and |
| 2083 | disabled states. |
| 2084 | \&\fIColor\fR |
| 2085 | may be specified in any of the forms accepted by \fBTk_GetColor\fR. |
| 2086 | If \fIcolor\fR is undef (the default), |
| 2087 | then 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 |
| 2096 | This option specifies the color that should be used to draw the |
| 2097 | outline of the rectangle in its normal, active and disabled states. |
| 2098 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 2099 | This option defaults to \fBblack\fR. |
| 2100 | If \fIcolor\fR is undef then no outline will be |
| 2101 | drawn 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 |
| 2110 | This option specifies stipple patterns that should be used to draw the |
| 2111 | outline of the rectangle in its normal, active and disabled states. |
| 2112 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 2113 | forms accepted by \fBTk_GetBitmap\fR. |
| 2114 | If the \fB\-outline\fR option hasn't been specified then this option |
| 2115 | has no effect. |
| 2116 | If \fIbitmap\fR is an empty string (the default), then the outline is drawn |
| 2117 | in a solid fashion. |
| 2118 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 2119 | .IX Item "-state => state" |
| 2120 | Modifies the state of the rectangle item where \fIstate\fR may be set to one of: |
| 2121 | normal, disabled, or hidden. A rectangle item may also be in the \*(L"active\*(R" |
| 2122 | state if the mouse is currently over it. Many options can take |
| 2123 | separate specifications in normal, active and disabled states such that the |
| 2124 | appearance 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 |
| 2133 | This option specifies stipple patterns that should be used to fill the |
| 2134 | the rectangle in its normal, active and disabled states. |
| 2135 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 2136 | forms accepted by \fBTk_GetBitmap\fR. |
| 2137 | If the \fB\-fill\fR option hasn't been specified then this option |
| 2138 | has no effect. |
| 2139 | If \fIbitmap\fR is an empty string (the default), then filling |
| 2140 | is done in a solid fashion. |
| 2141 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 2142 | .IX Item "-tags => tagList" |
| 2143 | Specifies a set of tags to apply to the item. |
| 2144 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 2145 | existing 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" |
| 2149 | Specifies a callback that is to be executed every time |
| 2150 | the 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 |
| 2159 | Specifies the width of the outline to be drawn around |
| 2160 | the rectangle, in its normal, active and disabled states. |
| 2161 | \&\fIOutlineWidth\fR specifies the width of the outline to be drawn around |
| 2162 | the rectangle, in any of the forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 2163 | .Sp |
| 2164 | If the \fB\-outline\fR option hasn't been specified then this option |
| 2165 | has no effect. |
| 2166 | Wide outlines are drawn centered on the rectangular path |
| 2167 | defined by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. |
| 2168 | This option defaults to 1.0. |
| 2169 | .SH "TEXT ITEMS" |
| 2170 | .IX Header "TEXT ITEMS" |
| 2171 | A text item displays a string of characters on the screen in one |
| 2172 | or more lines. |
| 2173 | Text items support indexing and selection, along with the |
| 2174 | following text-related canvas methods: \fBdchars\fR, |
| 2175 | \&\fBfocus\fR, \fBicursor\fR, \fBindex\fR, \fBinsert\fR, |
| 2176 | \&\fBselect\fR. |
| 2177 | Text items are created with methods of the following |
| 2178 | form: |
| 2179 | .PP |
| 2180 | .Vb 1 |
| 2181 | \& $canvas->createText(x, y, ?option, value, option, value, ...?) |
| 2182 | .Ve |
| 2183 | .PP |
| 2184 | The arguments \fIx\fR and \fIy\fR specify the coordinates of a |
| 2185 | point used to position the text on the display (see the options |
| 2186 | below for more information on how text is displayed). |
| 2187 | After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR |
| 2188 | pairs, each of which sets one of the configuration options |
| 2189 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 2190 | used in \fBitemconfigure\fR methods to change the item's |
| 2191 | configuration. |
| 2192 | The 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 |
| 2196 | positioning point for the text; it may have any of the forms |
| 2197 | accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR |
| 2198 | is \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 |
| 2200 | the top center point of the rectangular region occupied by the |
| 2201 | text will be at the positioning point. |
| 2202 | This 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 |
| 2211 | Specifies the color to be used to fill the text in its normal, active, and |
| 2212 | disabled states. |
| 2213 | \&\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. |
| 2214 | If \fIcolor\fR is undef then the text will be transparent. |
| 2215 | If this option isn't specified then it defaults to \fBblack\fR. |
| 2216 | .IP "\fB\-font\fR => \fIfontName\fR" 4 |
| 2217 | .IX Item "-font => fontName" |
| 2218 | Specifies the font to use for the text item. |
| 2219 | \&\fIFontName\fR may be any string acceptable to \fBTk_GetFontStruct\fR. |
| 2220 | If this option isn't specified, it defaults to a system-dependent |
| 2221 | font. |
| 2222 | .IP "\fB\-justify\fR => \fIhow\fR" 4 |
| 2223 | .IX Item "-justify => how" |
| 2224 | Specifies how to justify the text within its bounding region. |
| 2225 | \&\fIHow\fR must be one of the values \fBleft\fR, \fBright\fR, |
| 2226 | or \fBcenter\fR. |
| 2227 | This option will only matter if the text is displayed as multiple |
| 2228 | lines. |
| 2229 | If the option is omitted, it defaults to \fBleft\fR. |
| 2230 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 2231 | .IX Item "-state => state" |
| 2232 | Modifies the state of the text item where \fIstate\fR may be set to one of: |
| 2233 | normal, disabled, or hidden. A text item may also be in the \*(L"active\*(R" |
| 2234 | state if the mouse is currently over it. Many options can take |
| 2235 | separate specifications in normal, active and disabled states such that the |
| 2236 | appearance 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 |
| 2245 | This option specifies stipple patterns that should be used to fill the |
| 2246 | the text in its normal, active and disabled states. |
| 2247 | \&\fIbitmap\fR specifies the stipple pattern to use, in any of the |
| 2248 | forms accepted by \fBTk_GetBitmap\fR. |
| 2249 | If \fIbitmap\fR is an empty string (the default) then the text |
| 2250 | is drawn in a solid fashion. |
| 2251 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 2252 | .IX Item "-tags => tagList" |
| 2253 | Specifies a set of tags to apply to the item. |
| 2254 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 2255 | existing 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. |
| 2260 | Newline characters cause line breaks. |
| 2261 | The characters in the item may also be changed with the |
| 2262 | \&\fBinsert\fR and \fBdelete\fR methods. |
| 2263 | This option defaults to an empty string. |
| 2264 | .IP "\fB\-updatecommand\fR => \fIcommand\fR" 4 |
| 2265 | .IX Item "-updatecommand => command" |
| 2266 | Specifies a callback that is to be executed every time |
| 2267 | the text item is updated on the screen. |
| 2268 | .IP "\fB\-width\fR => \fIlineLength\fR" 4 |
| 2269 | .IX Item "-width => lineLength" |
| 2270 | Specifies a maximum line length for the text, in any of the forms |
| 2271 | described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 2272 | If this option is zero (the default) the text is broken into |
| 2273 | lines only at newline characters. |
| 2274 | However, if this option is non-zero then any line that would |
| 2275 | be longer than \fIlineLength\fR is broken just before a space |
| 2276 | character to make the line shorter than \fIlineLength\fR; the |
| 2277 | space character is treated as if it were a newline |
| 2278 | character. |
| 2279 | .SH "WINDOW ITEMS" |
| 2280 | .IX Header "WINDOW ITEMS" |
| 2281 | Items of type \fBwindow\fR cause a particular window to be displayed |
| 2282 | at a given position on the canvas. |
| 2283 | Window 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 |
| 2287 | The arguments \fIx\fR and \fIy\fR specify the coordinates of a |
| 2288 | point used to position the window on the display (see the \fB\-anchor\fR |
| 2289 | option below for more information on how bitmaps are displayed). |
| 2290 | After the coordinates there may be any number of \fIoption-value\fR |
| 2291 | pairs, each of which sets one of the configuration options |
| 2292 | for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be |
| 2293 | used in \fBitemconfigure\fR method to change the item's |
| 2294 | configuration. |
| 2295 | The 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 |
| 2299 | positioning point for the item; it may have any of the forms |
| 2300 | accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR |
| 2301 | is \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 |
| 2303 | its top center point is at the positioning point. |
| 2304 | This option defaults to \fBcenter\fR. |
| 2305 | .IP "\fB\-height\fR => \fIpixels\fR" 4 |
| 2306 | .IX Item "-height => pixels" |
| 2307 | Specifies the height to assign to the item's window. |
| 2308 | \&\fIPixels\fR may have any of the |
| 2309 | forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 2310 | If this option isn't specified, or if it is specified as an empty |
| 2311 | string, then the window is given whatever height it requests internally. |
| 2312 | .IP "\fB\-state\fR => \fIstate\fR" 4 |
| 2313 | .IX Item "-state => state" |
| 2314 | Modifies the state of the window item where \fIstate\fR may be set to one of: |
| 2315 | normal, disabled, or hidden. |
| 2316 | .IP "\fB\-tags\fR => \fItagList\fR" 4 |
| 2317 | .IX Item "-tags => tagList" |
| 2318 | Specifies a set of tags to apply to the item. |
| 2319 | \&\fITagList\fR consists of a list of tag names, which replace any |
| 2320 | existing 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" |
| 2324 | Specifies a callback that is to be executed every time |
| 2325 | the window item is updated on the screen. |
| 2326 | .IP "\fB\-width\fR => \fIpixels\fR" 4 |
| 2327 | .IX Item "-width => pixels" |
| 2328 | Specifies the width to assign to the item's window. |
| 2329 | \&\fIPixels\fR may have any of the |
| 2330 | forms described in the \*(L"\s-1COORDINATES\s0\*(R" section above. |
| 2331 | If this option isn't specified, or if it is specified as an empty |
| 2332 | string, then the window is given whatever width it requests internally. |
| 2333 | .IP "\fB\-window\fR => \fI$widget\fR" 4 |
| 2334 | .IX Item "-window => $widget" |
| 2335 | Specifies the window to associate with this item. |
| 2336 | The window specified by \f(CW$widget\fR must either be a child of |
| 2337 | the 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 |
| 2340 | Note: due to restrictions in the ways that windows are managed, it is not |
| 2341 | possible to draw other graphical items (such as lines and images) on top |
| 2342 | of window items. A window item always obscures any graphics that |
| 2343 | overlap it, regardless of their order in the display list. |
| 2344 | .SH "APPLICATION-DEFINED ITEM TYPES" |
| 2345 | .IX Header "APPLICATION-DEFINED ITEM TYPES" |
| 2346 | It is possible for individual applications to define new item |
| 2347 | types for canvas widgets using C code. |
| 2348 | See the documentation for \fBTk_CreateItemType\fR. |
| 2349 | .SH "BINDINGS" |
| 2350 | .IX Header "BINDINGS" |
| 2351 | Canvas has default bindings to allow scrolling if necessary: |
| 2352 | <Up>, <Down>, <Left> and <Right> (and their <Control\-*> counter |
| 2353 | parts). Further <Proir>, <Next>, <Home> and <End>. These |
| 2354 | bindings allow you to navigate the same way as in other |
| 2355 | widgets that can scroll. |
| 2356 | .SH "CREDITS" |
| 2357 | .IX Header "CREDITS" |
| 2358 | Tk'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 |
| 2360 | environment and preceded canvases by a year or two. Its simple |
| 2361 | mechanisms for placing and animating graphical objects inspired the |
| 2362 | functions of canvases. |
| 2363 | .SH "KEYWORDS" |
| 2364 | .IX Header "KEYWORDS" |
| 2365 | canvas, widget |