NSWindow 0.2 28 February, 2000 NSWindow Gui/NSWindow.h NSCoding

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:.

contentRectForFrameRect: frameRect defaultDepthLimit frameRectForContentRect: contentRect menuChanged: aMenu minFrameWidthWithTitle: aTitle styleMask: aStyle removeFrameUsingName: name acceptsMouseMovedEvents areCursorRectsEnabled aspectRatio backgroundColor backingType becomeKeyWindow becomeMainWindow cacheImageInRect: aRect canBecomeKeyWindow canBecomeMainWindow canStoreColor cascadeTopLeftFromPoint: topLeftPoint center close constrainFrameRect: frameRect contentView

Returns the NSWindow's content view.

convertBaseToScreen: aPoint convertScreenToBase: aPoint currentEvent dataWithEPSInsideRect: aRect deepestScreen defaultButtonCell delegate deminiaturize: sender depthLimit deviceDescription disableCursorRects disableFlushWindow disableKeyEquivalentForDefaultButtonCell discardCachedImage discardCursorRects discardEventsMatchingMask: mask beforeEvent: lastEvent display displayIfNeeded dragImage: anImage at: aPoint offset: initialOffset event: theEvent pasteboard: pboard source: sourceObject slideBack: slideBack enableCursorRects enableFlushWindow enableKeyEquivalentForDefaultButtonCell endEditingFor: anObject fax: sender fieldEditor: createFlag firstResponder flushWindow flushWindowIfNeeded frame frameAutosaveName gState hasDynamicDepthLimit hidesOnDeactivate initialFirstResponder initWithContentRect: contentRect styleMask: styleMask backing: backingType

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: styleMask 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.

interfaceStyle invalidateCursorRectsForView: aView isAutodisplay isDocumentEdited isExcludedFromWindowsMenu isFlushWindowDisabled isKeyWindow isMainWindow isMiniaturized isOneShot isReleasedWhenClosed isVisible isZoomed; keyDown: theEvent keyViewSelectionDirection level makeFirstResponder: aResponder makeKeyAndOrderFront: sender makeKeyWindow makeMainWindow maxSize miniaturize: sender miniwindowImage miniwindowTitle minSize mouseLocationOutsideOfEventStream nextEventMatchingMask: mask nextEventMatchingMask: mask untilDate: expirationDate inMode: mode dequeue: dequeue orderBack: sender orderFront: sender orderFrontRegardless orderOut: sender orderWindow: place relativeTo: otherWindowNumber performClose: sender performMiniaturize: sender performZoom: sender postEvent: anEvent print: sender registerForDraggedTypes: pboardTypes representedFilename resetCursorRects resignKeyWindow resignMainWindow resizeFlags resizeIncrements restoreCachedImage saveFrameUsingName: name screen selectKeyViewFollowingView: aView selectKeyViewPrecedingView: aView selectNextKeyView: sender selectPreviousKeyView: sender sendEvent: theEvent setAcceptsMouseMovedEvents: flag setAspectRatio: ratio setAutodisplay: flag setBackgroundColor: aColor setBackingType: backingType setContentSize: aSize setContentView: aView

Sets the window's content view to aView, replacing any previous content view.

setDefaultButtonCell: aButtonCell setDelegate: anObject setDepthLimit: limit setDocumentEdited: flag setDynamicDepthLimit: flag setExcludedFromWindowsMenu: flag setFrame: frameRect setFrameAutosaveName: name setFrameFromString: aString setFrameOrigin: aPoint setFrameTopLeftPoint: aPoint setFrameUsingName: name setHidesOnDeactivate: flag setInitialFirstResponder: aView setInterfaceStyle: interfaceStyle setLevel: newLevel setMaxSize: aSize setMiniwindowImage: anImage setMiniwindowTitle: aString setMinSize: aSize setOneShot: flag setReleasedWhenClosed: flag setRepresentedFilename: path setResizeIncrements: increments setTitle: aString

Sets the window's title to the string aString.

setTitleWithRepresentedFilename: path setViewsNeedDisplay: flag setWindowController: windowController stringWithSavedFrame styleMask title

Returns an NSString containing the text of the window's title.

tryToPerform: anAction unregisterDraggedTypes update useOptimizedDrawing: flag validRequestorForSendType: sendType returnType: returnType viewsNeedDisplay windowController windowHandle windowNumber worksWhenModal zoom: sender