Instances of the NSWindow class handle on-screen
windows, their associated NSViews, and events generate
by the user. An NSWindow's size is defined by its frame
rectangle, which encompasses its entire structure,
and its content rectangle, which includes only the content.
Every NSWindow has a content view, the NSView which forms
the root of the window's view hierarchy. This view can be
set using the setContentView: method, and
accessed through the contentView method.
setContentView: replaces the default
content view created by NSWindow.
Other views may be added to the window by using the
content view's addSubview: method. These
subviews can also have subviews added, forming a tree
structure, the view hierarchy. When an NSWindow must
display itself, it causes this hierarchy to draw
itself. Leaf nodes in the view hierarchy are drawn
last, causing them to potentially obscure views further
up in the hierarchy.
A delegate can be specified for an NSWindow, which will
receive notifications of events pertaining to the
window. The delegate is set using
setDelegate:, and can be retrieved using
delegate. The delegate can restrain
resizing by implementing the
windowWillResize: toSize: method, or
control the closing of the window by implementing
windowShouldClose:.
An NSWindow instance represents a window, panel or menu
on the screen. Each window has a style, which
determines how the window is decorated: ie
whether it has a border, a title bar, a resize bar,
minimise and close buttons.
A window has a frame. This is the frame of the
entire window on the screen, including all
decorations and borders. The origin of the
frame represents its bottom left corner and the frame
is expressed in screen coordinates (see
NSScreen
).
When a window is created, it has a privateNSView
instance which fills the entire window frame
and whose coordinate system is the same as the base
coordinate system of the window (ie zero x
and y coordinates are at the bottom left corner of
the window, with increasing x and y corresponding
to points to the right and above the origin).
This view may be used by the library internals
(and theme engines) to draw window decorations if
the backend library is not handling the window
decorations.
A window always contains a content view
which is the highest level view available for
public (application) use. This view fills the
area of the window inside any decoration/border.
This is the only part of the window that
application programmers are allowed to draw
in directly.
Returns the rectangle which would be used for the
content view of a window whose on-screen size and
position is specified by aRect and
which is decorated with the border and title etc
given by aStyle. Both rectangles
are expressed in screen coordinates.
Returns the rectangle which would be used for the
on-screen frame of a window if that window had a
content view occupying the rectangle
aRect and was decorated with the border
and title etc given by aStyle. Both
rectangles are expressed in screen coordinates.
Returns YES if the receiver can be
made key. If this method returns NO, the
window will not be made key. This implementation
returns YES if the window is resizable
or has a title bar. You can override this method to
change it's behavior
Returns YES if the receiver can be the
main window. If this method returns NO,
the window will not become the main window. This
implementation returns YES if
the window is resizable or has a title bar and is
visible and is not an NSPanel. You can override
this method to change it's behavior
Positions the receiver at topLeftPoint
(or if topLeftPoint is NSZeroPoint, leaves
the receiver unmoved except for any necessary
constraint to fit on screen). Returns the
position of the top left corner of the receivers
content view (after repositioning), so that another
window cascaded at the returned point will not
obscure the title bar of the receiver.
Converts aPoint from the base
coordinate system of the receiver to a point in
the screen coordinate system. Convert from a
point in the base coordinate system for the window to
a point in the screen coordinate system.
Converts aPoint from the screen
coordinate system to a point in the base
coordinate system of the receiver.
Convert from a point in the screen coordinate
system to a point in the screen coordinate system of
the receiver.
Causes the window to deminiaturize. Normally you
would not call this method directly. A window is
automatically deminiaturized by the user via
a mouse click event. Does nothing it the window isn't
miniaturized.
Initializes the receiver with a content rect
of contentRect, a style mask of
styleMask, and a backing store type of
backingType. This is the designated
initializer.
The style mask values are
NSTitledWindowMask, for a window with
a title, NSClosableWindowMask, for a
window with a close widget,
NSMiniaturizableWindowMask, for a
window with a miniaturize widget, and
NSResizableWindowMask, for a window
with a resizing widget. These mask values can be
OR'd in any combination.
Backing store values are
NSBackingStoreBuffered,
NSBackingStoreRetained and
NSBackingStoreNonretained.
Creates a new window with the specified
characteristics. The
contentRect is expressed in screen
coordinates (for aScreen) and the
window frame is calculated from the content
rectangle and the window style mask.
Initializes the receiver with a content rect
of contentRect, a style mask of
styleMask, a backing store type of
backingType and a boolean
flag. flag specifies whether
the window should be created now (NO),
or when it is displayed (YES).
The style mask values are
NSTitledWindowMask, for a window with
a title, NSClosableWindowMask, for a
window with a close widget,
NSMiniaturizableWindowMask, for a
window with a miniaturize widget, and
NSResizableWindowMask, for a window
with a resizing widget. These mask values can be
OR'd in any combination.
Backing store values are
NSBackingStoreBuffered,
NSBackingStoreRetained and
NSBackingStoreNonretained.
This method attempts to make aResponder the
first responder. If aResponder is
already the first responder, this method has no
effect and simply returns YES.
Otherwise, the method sends a
-resignFirstResponder
message to the current first responder (if there is
one) and immediately returns NO if the
current first responder refuses to resign.
Then the method asks aResponder to become
first responder by sending it a
-becomeFirstResponder
message, and if that returns YES then
this method immediately returns YES.
However, if that returns NO, the
receiver is made the first responder by sending it
a
-becomeFirstResponder
message, and this method returns NO.
If aResponder is neither
nil nor an instance of NSResponder (or
of a subclass of NSResponder) then behavior is undefined
(though the current GNUstep implementation just
returns NO). Makes
aResponder the first responder within the
receiver.
Causes the window to miniaturize, that is the window
is removed from the screen and it's counterpart
(mini)window is displayed. Does nothing if the
window can't be miniaturized (eg. because it's
already miniaturized).
If the application is active, orders the window to the
front in its level. If the application is not active,
the window is ordered in as far forward as possible in
its level without being ordered in front of the key or
main window of the currently active app. The current
key and main window status is not changed. Equivalent
to
-orderWindow:relativeTo:
with arguments NSWindowAbove and 0.
Orders the window to the front in its level (even in
front of the key and main windows of the current app)
regardless of whether the app is current or not.
This method should only be used in rare cases where
the app is cooperating with another app that is
displaying data for it. The current key and main
window status is not changed.
If place is NSWindowOut, removes the window
from the screen. If place is
NSWindowAbove, places the window directly
above otherWin, or directly above all
windows in its level if otherWin is 0.
If place is NSWindowBelow, places the
window directly below otherWin, or
directly below all windows in its level if
otherWin is 0.
If otherWin is zero and the key window is
at the same window level as the receiver, the receiver
cannot be positioned above the key window.
If place is NSWindowAbove or NSWindowBelow
and the application is hidden, the application is
unhidden.
Causes the window to close. Calls the
windowShouldClose: method on the
delegate to determine if it should close and calls
shouldCloseWindowController on
the controller for the receiver.
Miniaturize the receiver... as
long as its style mask includes
NSMiniaturizableWindowMask (and
as long as the receiver is not an icon
or mini window itsself). Calls
-miniaturize:
to do this. Beeps if the window can't be
miniaturised. Should ideally provide
visual feedback (highlighting the miniaturize button
as if it had been clicked) first... but that's not yet
implemented.
Set document edit status. If YES, then, if
the receiver has a close button, the close button will
show a broken X. If NO, then, if the
reciever has a close button, the close button will
show a solid X.
Sets the frame for the receiver to
frameRect and if flag is
YES causes the window contents to be
refreshed. The value of frameRect
is the desired on-screen size and position of the
window including all border/decoration.
The size of the frame is constrained to the minimum
and maximum sizes set for the receiver (if any).
Its position is constrained to be on screen
if it is a titled window.
Zooms the receiver. This method calls the delegate
method windowShouldZoom:toFrame: to determine if the
window should be allowed to zoom to full screen.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.