Table 34-13. Canvas attribute resource names.
background | The normal background color. |
borderWidth | The width of the border around the canvas. |
closeEnough | Distance from mouse to an overlapping object. |
confine | Boolean. True constrains the view to the scroll region. |
cursor | Cursor to display when mouse is over the widget. |
height | Height, in screen units, of canvas display. |
highlightBackground | Focus highlight color when widget does not have focus. |
highlightColor | Color for input focus highlight border. |
highlightThickness | Width of highlight border. |
insertBackground | Background for area covered by insert cursor. |
insertBorderwidth | Width of cursor border. Nonzero for 3D effect. |
insertOffTime | Time, in milliseconds the insert cursor blinks off. |
insertOnTime | Time, in milliseconds the insert cursor blinks on. |
insertWidth | Width of insert cursor. Default is 2. |
relief | flat, sunken, raised, groove, solid, or ridge. |
scrollIncrement | The minimum scrolling distance. |
scrollRegion | Left, top, right, and bottom coordinates of the canvas. |
selectBackground | Background color of selection. |
selectForeground | Foreground color of selection. |
selectBorderWidth | Width of selection border. Nonzero for 3D effect. |
takeFocus | Controls focus changes from keyboard traversal. |
width | Width in screen units for viewable area. |
xScrollCommand | Tcl command prefix for horizontal scrolling. |
xScrollIncrement | Distance for one scrolling unit in the X direction. |
yScrollCommand | Tcl command prefix for vertical scrolling. |
yScrollIncrement | Distance for one scrolling unit in the Y direction. |
The scroll region of a canvas defines the boundaries of the canvas coordinate space. It is specified as four coordinates, x1 y1 x2 y2 where (x1, y1) is the top-left corner and (x2, y2) is the lower-right corner. If the confine attribute is true, then the canvas cannot be scrolled outside this region. It is OK to position canvas objects partially or totally off the scroll region; they just may not be visible. The scroll increment attributes determine how much the canvas is scrolled when the user clicks on the arrows in the scrollbar.