O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

canvas

canvas pathName [option value...]

The canvas command creates a new canvas widget named pathName. The canvas widget provides a drawing area for displaying a number of graphic items, including arcs, bitmaps, images, lines, ovals, polygons, rectangles, text, and windows (other widgets). Methods exist to draw, manipulate, and bind events to items.

Standard Options

-background

-borderwidth

-cursor

-highlightbackground

-highlightcolor

-highlightthickness

-insertbackground

-insertborderwidth

-insertofftime

-insertontime

-insertwidth

-relief

-selectbackground

-selectborderwidth

-selectforeground

-takefocus

-xscrollcommand

-yscrollcommand

Widget-Specific Options

-closeenough float (closeEnough, CloseEnough)

How close the mouse cursor must be to an item to be considered inside it. Default is 1.0.

-confine boolean (confine, Confine)

Whether the view can be set outside the region defined by -scrollregion. Default is true.

-height height (height, Height)

Desired height, in screen units, that the canvas should request from its geometry manager.

-scrollregion region (scrollRegion, ScrollRegion)

Boundary for scrolling in the canvas as a list of four coordinates describing the left, top, right, and bottom coordinates of a rectangular region in screen units.

-width width (width, Width)

Width, in screen units, that the canvas should request from its geometry manager.

-xscrollincrement increment (xScrollIncrement, ScrollIncrement)

Increment, in screen units, for horizontal scrolling. If not set or equal to zero or less, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required