NSView is an abstract class which provides facilities for drawing in a window and receiving events. It is the superclass of many of the visual elements of the GUI.
In order to display itself, a view must be placed in a window (represented by an NSWindow object). Within the window is a hierarchy of NSViews, headed by the window's content view. Every other view in a window is a descendant of this view.
Subclasses can override drawRect:
in order to implement their
appearance. Other methods of NSView and NSResponder can also be overridden to handle
user generated events.
As of yet, unimplemented.
Returns the view which currently has the focus.
Returns YES
if the view object will accept the first click
received when in an inactive window, and NO
otherwise.
Adds aView as a subview of the receiver.
Returns self
if aView is the receiver or aView is a
subview of the receiver, the ancestor view shared by aView and the receiver,
if any, aView if it is an ancestor of the receiver, otherwise returns
nil
.
Returns the subview, lowest in the receiver's hierarchy, which contains aPoint
Returns YES
if aView is an ancestor of the receiver.
As of yet, unimplemented.
Returns whether or not aPoint lies within aRect.
Removes the receiver from its superviews list of subviews, by invoking the superviews [-removeSubview:] method, and marks the rectangle that the reciever occupied in the superview as needing redisplay.
This is dangerous to use during display, since it alters the rectangles needing display.
Removes the receiver from its superviews list of subviews, by invoking the superviews [-removeSubview:] method.
Removes the view from the receivers list of subviews and from the responder chain.
Also invokes [aView -viewWillMoveToWindow: nil] to handle removal of aView (and recursively, its children) from its window - performing tidyup by invalidating cursor rects etc.
Removes oldView from the receiver and places newView in its place.
Notifies the receiver that its superview is being changed to newSuperview.
Notifies the receiver that it will now be a view of newWindow.
Returns the window in which the receiver resides.