NSWindow scottc@net-community.com far@ix.netcom.com richard@brainstorm.co.uk The window class 1996 Free Software Foundation, Inc. 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 defaultDepthLimit frameRectForContentRect: aRect styleMask: aStyle menuChanged: aMenu minFrameWidthWithTitle: aTitle styleMask: aStyle removeFrameUsingName: name acceptsMouseMovedEvents alphaValue animationResizeTime: newFrame areCursorRectsEnabled aspectRatio backgroundColor backingType becomeKeyWindow becomeMainWindow cacheImageInRect: aRect canBecomeKeyWindow canBecomeMainWindow canHide canStoreColor cascadeTopLeftFromPoint: topLeftPoint center close constrainFrameRect: frameRect toScreen: screen contentView convertBaseToScreen: basePoint convertScreenToBase: screenPoint counterpart currentEvent dataWithEPSInsideRect: rect dataWithPDFInsideRect: aRect deepestScreen defaultButtonCell delegate 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 deviceDescription disableCursorRects disableFlushWindow disableKeyEquivalentForDefaultButtonCell discardCachedImage discardCursorRects discardEventsMatchingMask: mask beforeEvent: lastEvent display displayIfNeeded dragImage: anImage at: baseLocation offset: initialOffset event: event pasteboard: pboard source: sourceObject slideBack: slideFlag drawers enableCursorRects enableFlushWindow enableKeyEquivalentForDefaultButtonCell endEditingFor: anObject fax: sender fieldEditor: createFlag forObject: anObject firstResponder flushWindow flushWindowIfNeeded frame frameAutosaveName gState hasDynamicDepthLimit hasShadow hidesOnDeactivate 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 initialFirstResponder invalidateCursorRectsForView: aView isAutodisplay isDocumentEdited isExcludedFromWindowsMenu isFlushWindowDisabled isKeyWindow isMainWindow isMiniaturized isOneShot isOpaque isReleasedWhenClosed isVisible keyDown: theEvent keyViewSelectionDirection level makeFirstResponder: aResponder makeKeyAndOrderFront: sender makeKeyWindow makeMainWindow maxSize minSize 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 miniwindowTitle mouseLocationOutsideOfEventStream nextEventMatchingMask: mask nextEventMatchingMask: mask untilDate: expiration inMode: mode dequeue: deqFlag orderBack: sender orderFront: sender orderFrontRegardless orderOut: sender orderWindow: place relativeTo: otherWin performClose: sender performMiniaturize: sender performZoom: sender postEvent: event atStart: flag print: sender registerForDraggedTypes: newTypes representedFilename resetCursorRects resignKeyWindow resignMainWindow resizeFlags resizeIncrements restoreCachedImage runToolbarCustomizationPalette: sender saveFrameUsingName: name screen selectKeyViewFollowingView: aView selectKeyViewPrecedingView: aView selectNextKeyView: sender selectPreviousKeyView: sender sendEvent: theEvent setAcceptsMouseMovedEvents: flag setAlphaValue: windowAlpha setAspectRatio: ratio setAutodisplay: flag setBackgroundColor: color setBackingType: type setCanHide: flag 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 display: flag setFrame: frameRect display: displayFlag animate: animationFlag setFrameAutosaveName: name setFrameFromString: string setFrameOrigin: aPoint setFrameTopLeftPoint: aPoint setFrameUsingName: name setFrameUsingName: name force: force setHasShadow: hasShadow setHidesOnDeactivate: flag setInitialFirstResponder: aView setLevel: newLevel setMaxSize: aSize setMinSize: aSize setMiniwindowImage: image setMiniwindowTitle: title setOneShot: flag setOpaque: isOpaque setReleasedWhenClosed: flag setRepresentedFilename: aString setResizeIncrements: aSize setShowsResizeIndicator: show setTitle: aString Sets the window's title to the string aString. setTitleWithRepresentedFilename: aString setToolbar: toolbar setViewsNeedDisplay: flag setWindowController: windowController showsResizeIndicator stringWithSavedFrame styleMask title Returns an NSString containing the text of the window's title. toggleToolbarShown: sender toolbar tryToPerform: anAction with: anObject unregisterDraggedTypes update useOptimizedDrawing: flag validRequestorForSendType: sendType returnType: returnType viewsNeedDisplay windowController windowHandle windowNumber windowRef worksWhenModal zoom: sender
Software documentation for the NSObject(NSWindowDelegate) category AppKit/NSWindow.h windowDidBecomeKey: aNotification windowDidBecomeMain: aNotification windowDidChangeScreen: aNotification windowDidDeminiaturize: aNotification windowDidExpose: aNotification windowDidMiniaturize: aNotification windowDidMove: aNotification windowDidResignKey: aNotification windowDidResignMain: aNotification windowDidResize: aNotification windowDidUpdate: aNotification windowShouldClose: sender windowShouldZoom: sender toFrame: aFrame windowWillClose: aNotification windowWillMiniaturize: aNotification windowWillMove: aNotification windowWillResize: sender toSize: frameSize windowWillReturnFieldEditor: sender toObject: client windowWillUseStandardFrame: sender defaultFrame: aFrame Software documentation for the NSWindow(GNUstepBackend) category AppKit/NSWindow.h _captureMouse: sender _initDefaults _releaseMouse: sender _setVisible: flag Software documentation for the NSWindow(GNUstepTextView) category AppKit/NSWindow.h _futureFirstResponder