nget-shape-line

Generic Function

Package: common-graphics

Arguments: stream start-position old-position draw-fn erase-fn &optional scroll-p cursor

A destructive version of get-shape-line. The old-position argument is modified to be the endpoint position chosen by the user and then returned. Like get-shape-line, this function waits as the user moves the mouse about to establish the second endpoint (the first is start-position and cannot be modified by the user) of the desired line. When the user presses a mouse button to establish the endpoint, old-position is set to that position and returned.

draw-fn is called each time the line is to be drawn and erase-fn each time it is to be erased. The draw-fn and erase-fn should each take three arguments: the stream, the start-position, and the mouse-cursor position. When they are called, the stream brush will be set to one pixel-width black, the stream paint operation to invert. Thus, drawing the shape twice will suffice.

As the mouse moves about, candidate lines are drawn and erased using draw-fn and erase-fn.

If scroll-p is true, the window identified by stream will be scrolled if the cursor moves outside it. Sets the stream cursor to cursor while running. If the cursor argument is t, a stream default is used (typically the cross-hair cursor).

Note: incompatible change in release 6.0: in releases prior to 6.0, when a frame-with-single-child instance was passed to this operator, the operator was actually applied to the child (the result of applying frame-child to the frame-with-single-child instance). In release 6.0, this redirection no longer occurs. If you intend this operator to apply to the frame-child, pass that to this operator rather than the parent. This is a non-backward-compatible-change. See the release notes for more information.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.