Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 2 - Newton Works Draw Application / Using the Drawing Application Interface


Draw Application Methods

In addition to the *RegTool, *RegPatterns, and *RegStamps methods, and their unregistering counterparts discussed elsewhere in this chapter, the Draw application's viewDef contains three other methods of interest: *GetContents, *SetContents, and *GetCanvas. The *GetContents and *SetContents methods are used to manipulate the entire contents of the current drawing.

The *GetCanvas method returns a reference to the canvas view; a number of methods are defined in this view which are available to you. For more information on the canvas view, see "The Canvas and Its Methods".

The way you get a reference to the Draw application viewDef, to send these methods to, depends on the environment in which your code is executing.

:GetContents();

:GetCanvas();

viewDefView:GetContents();

viewDefView:GetCanvas();

if GetRoot().newtWorks AND Visible(GetRoot().newtWorks) then

begin local curNWApp := GetRoot().newtWorks.viewDefView; if GetVariable(curNWApp, 'currentdatatype) = 'drawPaper then begin local cont := curNWApp:GetContents(); local can := curNWApp:GetCanvas(); ... end; end;


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help