23. The Canvas Widget
This chapter describes Tk’s canvas widget. Canvases allow you to display and manipulate a variety of graphical objects such as rectangles, lines, images, and text strings. The canvas widget supports powerful features of allowing you to tag objects and manipulate all the objects with a given tag. For example, you can move or recolor all of the items with a given tag. You can also create event bindings for tags so that a Tcl script is invoked whenever the pointer passes over a tagged rectangle in a canvas, whenever a button is pressed over a string in the widget, and so on. The tagging and binding mechanisms make it easy to “activate” text and graphics so that they respond to the mouse. This chapter provides an introduction ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access