The Canvas and Its Methods
The canvas view provides methods to programmatically add a shape to it, and a number of methods that manipulate the set of currently selected shapes. If you are writing code for a tool in the tool bar, simply send these methods toself
. Otherwise, use the *GetCanvas
method described in "Draw Application Methods".The current drawing style is stored in the canvas'
currentDrawStyle
slot. You may change the values in this style frame programmatically; the user can also set some of these slot through the user interface.The *
AddShape
method adds a new shape to the canvas. The canvas provides a*DirtyShape
method to redraw the part of the canvas where the new shape was added. Simply pass the same shape to both functions, as in:
A number of functions exist to select shapes, and manipulate them. You can programmatically call many of the methods the user accesses though the Edit and Arrange pickers. See "The Canvas".local shape := MakeRect (0,0,100,100);
:AddShape(shape,nil,nil); :DirtyShape(shape);
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help