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.


Inherits From: NSResponder : NSObject

Conforms To: NSCoding (NSResponder) NSObject (NSObject)

Declared In: AppKit/NSView.h


Class Description

NSView is an abstract class that provides its subclasses with a structure for drawing and for handling events. Any application that needs to display, print, or receive events must use NSView objects.

To be displayed, a view must be placed in a window (represented by an NSWindow object). All the views within a window are arranged in a hierarchy, with each view having a single superview and zero or more subviews. Each view has its own area to draw in and its own coordinate system, expressed as a transformation of its superview's coordinate system. An NSView object can scale, translate, or rotate its coordinates, or flip the polarity of its y-axis.

An NSView keeps track of its size and location in two ways: as a frame rectangle (expressed in its superview's coordinate system) and as a bounds rectangle (expressed in its own coordinate system). Both are represented by NSRect structures.

Subclasses of NSView typically override drawRect: to implement an object's distinctive appearance. They also frequently override one or more of NSView's or NSResponder's event-handling methods, to react to the user's manipulations of the mouse and keyboard.

Initializing NSView Objects

Managing the NSView Hierarchy

Modifying the Coordinate System

Converting Coordinates

Notifying Ancestor Views

Resizing Subviews

Graphics State Objects




Managing the Cursor

Assigning a Tag

Aiding Event Handling




Writing Conforming PostScript