NSWindow
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:
.
AppKit/NSWindow.h
NSCoding
contentRectForFrameRect:
aRect
styleMask:
aStyle
Description forthcoming.
defaultDepthLimit
Description forthcoming.
frameRectForContentRect:
aRect
styleMask:
aStyle
Description forthcoming.
menuChanged:
aMenu
Description forthcoming.
minFrameWidthWithTitle:
aTitle
styleMask:
aStyle
Description forthcoming.
removeFrameUsingName:
name
Description forthcoming.
acceptsMouseMovedEvents
Description forthcoming.
alphaValue
Description forthcoming.
animationResizeTime:
newFrame
Description forthcoming.
areCursorRectsEnabled
Description forthcoming.
aspectRatio
Description forthcoming.
backgroundColor
Description forthcoming.
backingType
Description forthcoming.
becomeKeyWindow
Description forthcoming.
becomeMainWindow
Description forthcoming.
cacheImageInRect:
aRect
Description forthcoming.
canBecomeKeyWindow
Description forthcoming.
canBecomeMainWindow
Description forthcoming.
canHide
Description forthcoming.
canStoreColor
Description forthcoming.
cascadeTopLeftFromPoint:
topLeftPoint
Description forthcoming.
center
Description forthcoming.
close
Description forthcoming.
constrainFrameRect:
frameRect
toScreen:
screen
Description forthcoming.
contentView
Description forthcoming.
convertBaseToScreen:
basePoint
Description forthcoming.
convertScreenToBase:
screenPoint
Description forthcoming.
counterpart
Description forthcoming.
currentEvent
Description forthcoming.
dataWithEPSInsideRect:
rect
Description forthcoming.
dataWithPDFInsideRect:
aRect
Description forthcoming.
deepestScreen
Description forthcoming.
defaultButtonCell
Description forthcoming.
delegate
Description forthcoming.
deminiaturize:
sender
Causes the window to deminiaturize. Normally you
would not call this method directly. A window is
automatically deminiaturized by the user via
a mouse cloick event.
depthLimit
Description forthcoming.
deviceDescription
Description forthcoming.
disableCursorRects
Description forthcoming.
disableFlushWindow
Description forthcoming.
disableKeyEquivalentForDefaultButtonCell
Description forthcoming.
discardCachedImage
Description forthcoming.
discardCursorRects
Description forthcoming.
discardEventsMatchingMask:
mask
beforeEvent:
lastEvent
Description forthcoming.
display
Description forthcoming.
displayIfNeeded
Description forthcoming.
dragImage:
anImage
at:
baseLocation
offset:
initialOffset
event:
event
pasteboard:
pboard
source:
sourceObject
slideBack:
slideFlag
Description forthcoming.
drawers
Description forthcoming.
enableCursorRects
Description forthcoming.
enableFlushWindow
Description forthcoming.
enableKeyEquivalentForDefaultButtonCell
Description forthcoming.
endEditingFor:
anObject
Description forthcoming.
fax:
sender
Description forthcoming.
fieldEditor:
createFlag
forObject:
anObject
Description forthcoming.
firstResponder
Description forthcoming.
flushWindow
Description forthcoming.
flushWindowIfNeeded
Description forthcoming.
frame
Description forthcoming.
frameAutosaveName
Description forthcoming.
gState
Description forthcoming.
hasDynamicDepthLimit
Description forthcoming.
hasShadow
Description forthcoming.
hidesOnDeactivate
Description forthcoming.
initWithContentRect:
contentRect
styleMask:
aStyle
backing:
bufferingType
defer:
flag
Initializes the receiver with a content rect
of contentRect, a style mask of
styleMask, and a backing store type of
backingType.
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
.
initWithContentRect:
contentRect
styleMask:
aStyle
backing:
bufferingType
defer:
flag
screen:
aScreen
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
.
initWithWindowRef:
windowRef
Description forthcoming.
initialFirstResponder
Description forthcoming.
invalidateCursorRectsForView:
aView
Description forthcoming.
isAutodisplay
Description forthcoming.
isDocumentEdited
Description forthcoming.
isExcludedFromWindowsMenu
Description forthcoming.
isFlushWindowDisabled
Description forthcoming.
isKeyWindow
Description forthcoming.
isMainWindow
Description forthcoming.
isMiniaturized
Description forthcoming.
isOneShot
Description forthcoming.
isOpaque
Description forthcoming.
isReleasedWhenClosed
Description forthcoming.
isVisible
Description forthcoming.
keyDown:
theEvent
Description forthcoming.
keyViewSelectionDirection
Description forthcoming.
level
Description forthcoming.
makeFirstResponder:
aResponder
Description forthcoming.
makeKeyAndOrderFront:
sender
Description forthcoming.
makeKeyWindow
Description forthcoming.
makeMainWindow
Description forthcoming.
maxSize
Description forthcoming.
minSize
Description forthcoming.
miniaturize:
sender
Causes the window to miniaturize, that is the window
is removed from the screen and it's counterpart
(mini)window is displayed.
miniwindowImage
Description forthcoming.
miniwindowTitle
Description forthcoming.
mouseLocationOutsideOfEventStream
Description forthcoming.
nextEventMatchingMask:
mask
Description forthcoming.
nextEventMatchingMask:
mask
untilDate:
expiration
inMode:
mode
dequeue:
deqFlag
Description forthcoming.
orderBack:
sender
Description forthcoming.
orderFront:
sender
Description forthcoming.
orderFrontRegardless
Description forthcoming.
orderOut:
sender
Description forthcoming.
orderWindow:
place
relativeTo:
otherWin
Description forthcoming.
performClose:
sender
Description forthcoming.
performMiniaturize:
sender
Description forthcoming.
performZoom:
sender
Description forthcoming.
postEvent:
event
atStart:
flag
Description forthcoming.
print:
sender
Description forthcoming.
registerForDraggedTypes:
newTypes
Description forthcoming.
representedFilename
Description forthcoming.
resetCursorRects
Description forthcoming.
resignKeyWindow
Description forthcoming.
resignMainWindow
Description forthcoming.
resizeFlags
Description forthcoming.
resizeIncrements
Description forthcoming.
restoreCachedImage
Description forthcoming.
runToolbarCustomizationPalette:
sender
Description forthcoming.
saveFrameUsingName:
name
Description forthcoming.
screen
Description forthcoming.
selectKeyViewFollowingView:
aView
Description forthcoming.
selectKeyViewPrecedingView:
aView
Description forthcoming.
selectNextKeyView:
sender
Description forthcoming.
selectPreviousKeyView:
sender
Description forthcoming.
sendEvent:
theEvent
Description forthcoming.
setAcceptsMouseMovedEvents:
flag
Description forthcoming.
setAlphaValue:
windowAlpha
Description forthcoming.
setAspectRatio:
ratio
Description forthcoming.
setAutodisplay:
flag
Description forthcoming.
setBackgroundColor:
color
Description forthcoming.
setBackingType:
type
Description forthcoming.
setCanHide:
flag
Description forthcoming.
setContentSize:
aSize
Description forthcoming.
setContentView:
aView
Sets the window's content view to aView,
replacing any previous content view.
setDefaultButtonCell:
aButtonCell
Description forthcoming.
setDelegate:
anObject
Description forthcoming.
setDepthLimit:
limit
Description forthcoming.
setDocumentEdited:
flag
Description forthcoming.
setDynamicDepthLimit:
flag
Description forthcoming.
setExcludedFromWindowsMenu:
flag
Description forthcoming.
setFrame:
frameRect
display:
flag
Description forthcoming.
setFrame:
frameRect
display:
displayFlag
animate:
animationFlag
Description forthcoming.
setFrameAutosaveName:
name
Description forthcoming.
setFrameFromString:
string
Description forthcoming.
setFrameOrigin:
aPoint
Description forthcoming.
setFrameTopLeftPoint:
aPoint
Description forthcoming.
setFrameUsingName:
name
Description forthcoming.
setFrameUsingName:
name
force:
force
Description forthcoming.
setHasShadow:
hasShadow
Description forthcoming.
setHidesOnDeactivate:
flag
Description forthcoming.
setInitialFirstResponder:
aView
Description forthcoming.
setLevel:
newLevel
Description forthcoming.
setMaxSize:
aSize
Description forthcoming.
setMinSize:
aSize
Description forthcoming.
setMiniwindowImage:
image
Description forthcoming.
setMiniwindowTitle:
title
Description forthcoming.
setOneShot:
flag
Description forthcoming.
setOpaque:
isOpaque
Description forthcoming.
setReleasedWhenClosed:
flag
Description forthcoming.
setRepresentedFilename:
aString
Description forthcoming.
setResizeIncrements:
aSize
Description forthcoming.
setShowsResizeIndicator:
show
Description forthcoming.
setTitle:
aString
Sets the window's title to the string
aString.
setTitleWithRepresentedFilename:
aString
Description forthcoming.
setToolbar:
toolbar
Description forthcoming.
setViewsNeedDisplay:
flag
Description forthcoming.
setWindowController:
windowController
Description forthcoming.
showsResizeIndicator
Description forthcoming.
stringWithSavedFrame
Description forthcoming.
styleMask
Description forthcoming.
title
Returns an NSString containing the text of the
window's title.
toggleToolbarShown:
sender
Description forthcoming.
toolbar
Description forthcoming.
tryToPerform:
anAction
with:
anObject
Description forthcoming.
unregisterDraggedTypes
Description forthcoming.
update
Description forthcoming.
useOptimizedDrawing:
flag
Description forthcoming.
validRequestorForSendType:
sendType
returnType:
returnType
Description forthcoming.
viewsNeedDisplay
Description forthcoming.
windowController
Description forthcoming.
windowHandle
Description forthcoming.
windowNumber
Description forthcoming.
windowRef
Description forthcoming.
worksWhenModal
Description forthcoming.
zoom:
sender
Description forthcoming.