Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.

NSClipView

Inherits From: NSView : NSResponder : NSObject

Conforms To: NSCoding (NSResponder) NSObject (NSObject)

Declared In: AppKit/NSClipView.h

Class Description

An NSClipView object lets you scroll a document that may be larger than the NSClipView's frame rectangle, clipping the visible portion of the document to the frame. You don't normally use the NSClipView class directly; it's provided primarily as the scrolling machinery for the NSScrollView class. However, you might use the NSClipView class to implement a class similar to NSScrollView.

The document, which must be an NSView, is called the NSClipView's document view. An NSClipView's document view, which is set through the setDocumentView: method, is the NSClipView's only subview. You can set the cursor that's displayed when the mouse enters an NSClipView's frame (in other words, when it's poised over the document view) through the setDocumentCursor: method.

When the NSClipView is instructed to scroll its document view, it normally copies that portion of the document view that's visible both before and after the scrolling, so that this part won't need to be redrawn from scratch. However, you can turn off this behavior and force the entire visible area to be redrawn by sending the NSClipView a setCopiesOnScroll:NO message.

After scrolling, the NSClipView sends itself a setNeedsDisplayInRect: message to indicate that some part of the document view should be displayed again. The argument to this message is the freshly exposed area of the document view, unless the NSClipView received a setCopiesOnScroll:NO message, in which case the argument is the entire visible area.

The NSClipView sends its superview (usually an NSScrollView) a reflectScrolledClipView: message whenever the relationship between the NSClipView and the document view has changed. This allows the superview to update itself to reflect the changefor example, the NSScrollView class uses this method to change the position of its scrollers when the user causes the document to autoscroll.

Managing the Document View

Setting the Cursor

-(NSCursor *)documentCursor Returns the cursor for the document view.

- (void)setDocumentCursor:(NSCursor *)anObject Sets the cursor for the document view.

Setting the Background Color

Scrolling

Responding to a Changed Frame