NSWindow

Authors

Scott Christley( scottc@net-community.com )
Felipe A. Rodriguez( far@ix.netcom.com )
Richard Frith-Macdonald( richard@brainstorm.co.uk )
The window class

Copyright: (C) 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:.

NSWindow : NSResponder

Declared: AppKit/NSWindow.h
Conform: NSCoding

contentRectForFrameRect:styleMask:

+ (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (unsigned int)aStyle;


defaultDepthLimit

+ (NSWindowDepth) defaultDepthLimit;


frameRectForContentRect:styleMask:

+ (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (unsigned int)aStyle;


menuChanged:

+ (void) menuChanged: (NSMenu*)aMenu;


minFrameWidthWithTitle:styleMask:

+ (NSRect) minFrameWidthWithTitle: (NSString*)aTitle styleMask: (unsigned int)aStyle;


removeFrameUsingName:

+ (void) removeFrameUsingName: (NSString*)name;


acceptsMouseMovedEvents

- (BOOL) acceptsMouseMovedEvents;


alphaValue

- (float) alphaValue;


animationResizeTime:

- (NSTimeInterval) animationResizeTime: (NSRect)newFrame;


areCursorRectsEnabled

- (BOOL) areCursorRectsEnabled;


aspectRatio

- (NSSize) aspectRatio;


backgroundColor

- (NSColor*) backgroundColor;


backingType

- (NSBackingStoreType) backingType;


becomeKeyWindow

- (void) becomeKeyWindow;


becomeMainWindow

- (void) becomeMainWindow;


cacheImageInRect:

- (void) cacheImageInRect: (NSRect)aRect;


canBecomeKeyWindow

- (BOOL) canBecomeKeyWindow;


canBecomeMainWindow

- (BOOL) canBecomeMainWindow;


canHide

- (BOOL) canHide;


canStoreColor

- (BOOL) canStoreColor;


cascadeTopLeftFromPoint:

- (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint;


center

- (void) center;


close

- (void) close;


constrainFrameRect:toScreen:

- (NSRect) constrainFrameRect: (NSRect)frameRect toScreen: (id)screen;


contentView

- (id) contentView;


convertBaseToScreen:

- (NSPoint) convertBaseToScreen: (NSPoint)basePoint;


convertScreenToBase:

- (NSPoint) convertScreenToBase: (NSPoint)screenPoint;


counterpart

- (NSWindow*) counterpart;


currentEvent

- (NSEvent*) currentEvent;


dataWithEPSInsideRect:

- (NSData*) dataWithEPSInsideRect: (NSRect)rect;


dataWithPDFInsideRect:

- (NSData*) dataWithPDFInsideRect: (NSRect)aRect;


deepestScreen

- (NSScreen*) deepestScreen;


defaultButtonCell

- (NSButtonCell*) defaultButtonCell;


delegate

- (id) delegate;


deminiaturize:

- (void) deminiaturize: (id)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

- (NSWindowDepth) depthLimit;


deviceDescription

- (NSDictionary*) deviceDescription;


disableCursorRects

- (void) disableCursorRects;


disableFlushWindow

- (void) disableFlushWindow;


disableKeyEquivalentForDefaultButtonCell

- (void) disableKeyEquivalentForDefaultButtonCell;


discardCachedImage

- (void) discardCachedImage;


discardCursorRects

- (void) discardCursorRects;


discardEventsMatchingMask:beforeEvent:

- (void) discardEventsMatchingMask: (unsigned int)mask beforeEvent: (NSEvent*)lastEvent;


display

- (void) display;


displayIfNeeded

- (void) displayIfNeeded;


dragImage:at:offset:event:pasteboard:source:slideBack:

- (void) dragImage: (NSImage*)anImage at: (NSPoint)baseLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag;


drawers

- (NSArray*) drawers;


enableCursorRects

- (void) enableCursorRects;


enableFlushWindow

- (void) enableFlushWindow;


enableKeyEquivalentForDefaultButtonCell

- (void) enableKeyEquivalentForDefaultButtonCell;


endEditingFor:

- (void) endEditingFor: (id)anObject;


fax:

- (void) fax: (id)sender;


fieldEditor:forObject:

- (NSText*) fieldEditor: (BOOL)createFlag forObject: (id)anObject;


firstResponder

- (NSResponder*) firstResponder;


flushWindow

- (void) flushWindow;


flushWindowIfNeeded

- (void) flushWindowIfNeeded;


frame

- (NSRect) frame;


frameAutosaveName

- (NSString*) frameAutosaveName;


gState

- (int) gState;


hasDynamicDepthLimit

- (BOOL) hasDynamicDepthLimit;


hasShadow

- (BOOL) hasShadow;


hidesOnDeactivate

- (BOOL) hidesOnDeactivate;


initWithContentRect:styleMask:backing:defer:

- (id) initWithContentRect: (NSRect)contentRect styleMask: (unsigned int)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag;


initWithContentRect:styleMask:backing:defer:screen:

- (id) initWithContentRect: (NSRect)contentRect styleMask: (unsigned int)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag screen: (NSScreen*)aScreen;


initWithWindowRef:

- (NSWindow*) initWithWindowRef: (void*)windowRef;


initialFirstResponder

- (NSView*) initialFirstResponder;


invalidateCursorRectsForView:

- (void) invalidateCursorRectsForView: (NSView*)aView;


isAutodisplay

- (BOOL) isAutodisplay;


isDocumentEdited

- (BOOL) isDocumentEdited;


isExcludedFromWindowsMenu

- (BOOL) isExcludedFromWindowsMenu;


isFlushWindowDisabled

- (BOOL) isFlushWindowDisabled;


isKeyWindow

- (BOOL) isKeyWindow;


isMainWindow

- (BOOL) isMainWindow;


isMiniaturized

- (BOOL) isMiniaturized;


isOneShot

- (BOOL) isOneShot;


isOpaque

- (BOOL) isOpaque;


isReleasedWhenClosed

- (BOOL) isReleasedWhenClosed;


isVisible

- (BOOL) isVisible;


keyDown:

- (void) keyDown: (NSEvent*)theEvent;


keyViewSelectionDirection

- (NSSelectionDirection) keyViewSelectionDirection;


level

- (int) level;


makeFirstResponder:

- (BOOL) makeFirstResponder: (NSResponder*)aResponder;


makeKeyAndOrderFront:

- (void) makeKeyAndOrderFront: (id)sender;


makeKeyWindow

- (void) makeKeyWindow;


makeMainWindow

- (void) makeMainWindow;


maxSize

- (NSSize) maxSize;


minSize

- (NSSize) minSize;


miniaturize:

- (void) miniaturize: (id)sender;

Causes the window to miniaturize, that is the window is removed from the screen and it's counterpart (mini)window is displayed.


miniwindowImage

- (NSImage*) miniwindowImage;


miniwindowTitle

- (NSString*) miniwindowTitle;


mouseLocationOutsideOfEventStream

- (NSPoint) mouseLocationOutsideOfEventStream;


nextEventMatchingMask:

- (NSEvent*) nextEventMatchingMask: (unsigned int)mask;


nextEventMatchingMask:untilDate:inMode:dequeue:

- (NSEvent*) nextEventMatchingMask: (unsigned int)mask untilDate: (NSDate*)expiration inMode: (NSString*)mode dequeue: (BOOL)deqFlag;


orderBack:

- (void) orderBack: (id)sender;


orderFront:

- (void) orderFront: (id)sender;


orderFrontRegardless

- (void) orderFrontRegardless;


orderOut:

- (void) orderOut: (id)sender;


orderWindow:relativeTo:

- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin;


performClose:

- (void) performClose: (id)sender;


performMiniaturize:

- (void) performMiniaturize: (id)sender;


performZoom:

- (void) performZoom: (id)sender;


postEvent:atStart:

- (void) postEvent: (NSEvent*)event atStart: (BOOL)flag;


print:

- (void) print: (id)sender;


registerForDraggedTypes:

- (void) registerForDraggedTypes: (NSArray*)newTypes;


representedFilename

- (NSString*) representedFilename;


resetCursorRects

- (void) resetCursorRects;


resignKeyWindow

- (void) resignKeyWindow;


resignMainWindow

- (void) resignMainWindow;


resizeFlags

- (int) resizeFlags;


resizeIncrements

- (NSSize) resizeIncrements;


restoreCachedImage

- (void) restoreCachedImage;


runToolbarCustomizationPalette:

- (void) runToolbarCustomizationPalette: (id)sender;


saveFrameUsingName:

- (void) saveFrameUsingName: (NSString*)name;


screen

- (NSScreen*) screen;


selectKeyViewFollowingView:

- (void) selectKeyViewFollowingView: (NSView*)aView;


selectKeyViewPrecedingView:

- (void) selectKeyViewPrecedingView: (NSView*)aView;


selectNextKeyView:

- (void) selectNextKeyView: (id)sender;


selectPreviousKeyView:

- (void) selectPreviousKeyView: (id)sender;


sendEvent:

- (void) sendEvent: (NSEvent*)theEvent;


setAcceptsMouseMovedEvents:

- (void) setAcceptsMouseMovedEvents: (BOOL)flag;


setAlphaValue:

- (void) setAlphaValue: (float)windowAlpha;


setAspectRatio:

- (void) setAspectRatio: (NSSize)ratio;


setAutodisplay:

- (void) setAutodisplay: (BOOL)flag;


setBackgroundColor:

- (void) setBackgroundColor: (NSColor*)color;


setBackingType:

- (void) setBackingType: (NSBackingStoreType)type;


setCanHide:

- (void) setCanHide: (BOOL)flag;


setContentSize:

- (void) setContentSize: (NSSize)aSize;


setContentView:

- (void) setContentView: (NSView*)aView;

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


setDefaultButtonCell:

- (void) setDefaultButtonCell: (NSButtonCell*)aButtonCell;


setDelegate:

- (void) setDelegate: (id)anObject;


setDepthLimit:

- (void) setDepthLimit: (NSWindowDepth)limit;


setDocumentEdited:

- (void) setDocumentEdited: (BOOL)flag;


setDynamicDepthLimit:

- (void) setDynamicDepthLimit: (BOOL)flag;


setExcludedFromWindowsMenu:

- (void) setExcludedFromWindowsMenu: (BOOL)flag;


setFrame:display:

- (void) setFrame: (NSRect)frameRect display: (BOOL)flag;


setFrame:display:animate:

- (void) setFrame: (NSRect)frameRect display: (BOOL)displayFlag animate: (BOOL)animationFlag;


setFrameAutosaveName:

- (BOOL) setFrameAutosaveName: (NSString*)name;


setFrameFromString:

- (void) setFrameFromString: (NSString*)string;


setFrameOrigin:

- (void) setFrameOrigin: (NSPoint)aPoint;


setFrameTopLeftPoint:

- (void) setFrameTopLeftPoint: (NSPoint)aPoint;


setFrameUsingName:

- (BOOL) setFrameUsingName: (NSString*)name;


setFrameUsingName:force:

- (BOOL) setFrameUsingName: (NSString*)name force: (BOOL)force;


setHasShadow:

- (void) setHasShadow: (BOOL)hasShadow;


setHidesOnDeactivate:

- (void) setHidesOnDeactivate: (BOOL)flag;


setInitialFirstResponder:

- (void) setInitialFirstResponder: (NSView*)aView;


setLevel:

- (void) setLevel: (int)newLevel;


setMaxSize:

- (void) setMaxSize: (NSSize)aSize;


setMinSize:

- (void) setMinSize: (NSSize)aSize;


setMiniwindowImage:

- (void) setMiniwindowImage: (NSImage*)image;


setMiniwindowTitle:

- (void) setMiniwindowTitle: (NSString*)title;


setOneShot:

- (void) setOneShot: (BOOL)flag;


setOpaque:

- (void) setOpaque: (BOOL)isOpaque;


setReleasedWhenClosed:

- (void) setReleasedWhenClosed: (BOOL)flag;


setRepresentedFilename:

- (void) setRepresentedFilename: (NSString*)aString;


setResizeIncrements:

- (void) setResizeIncrements: (NSSize)aSize;


setShowsResizeIndicator:

- (void) setShowsResizeIndicator: (BOOL)show;


setTitle:

- (void) setTitle: (NSString*)aString;

Sets the window's title to the string aString.


setTitleWithRepresentedFilename:

- (void) setTitleWithRepresentedFilename: (NSString*)aString;


setToolbar:

- (void) setToolbar: (NSToolbar*)toolbar;


setViewsNeedDisplay:

- (void) setViewsNeedDisplay: (BOOL)flag;


setWindowController:

- (void) setWindowController: (NSWindowController*)windowController;


showsResizeIndicator

- (BOOL) showsResizeIndicator;


stringWithSavedFrame

- (NSString*) stringWithSavedFrame;


styleMask

- (unsigned int) styleMask;


title

- (NSString*) title;

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


toggleToolbarShown:

- (void) toggleToolbarShown: (id)sender;


toolbar

- (NSToolbar*) toolbar;


tryToPerform:with:

- (BOOL) tryToPerform: (SEL)anAction with: (id)anObject;


unregisterDraggedTypes

- (void) unregisterDraggedTypes;


update

- (void) update;


useOptimizedDrawing:

- (void) useOptimizedDrawing: (BOOL)flag;


validRequestorForSendType:returnType:

- (id) validRequestorForSendType: (NSString*)sendType returnType: (NSString*)returnType;


viewsNeedDisplay

- (BOOL) viewsNeedDisplay;


windowController

- (id) windowController;


windowHandle

- (void*) windowHandle;


windowNumber

- (int) windowNumber;


windowRef

- (void*) windowRef;


worksWhenModal

- (BOOL) worksWhenModal;


zoom:

- (void) zoom: (id)sender;


Software documentation for the NSObject(NSWindowDelegate) category

NSObject(NSWindowDelegate)

Declared: AppKit/NSWindow.h

windowDidBecomeKey:

- (void) windowDidBecomeKey: (NSNotification*)aNotification;


windowDidBecomeMain:

- (void) windowDidBecomeMain: (NSNotification*)aNotification;


windowDidChangeScreen:

- (void) windowDidChangeScreen: (NSNotification*)aNotification;


windowDidDeminiaturize:

- (void) windowDidDeminiaturize: (NSNotification*)aNotification;


windowDidExpose:

- (void) windowDidExpose: (NSNotification*)aNotification;


windowDidMiniaturize:

- (void) windowDidMiniaturize: (NSNotification*)aNotification;


windowDidMove:

- (void) windowDidMove: (NSNotification*)aNotification;


windowDidResignKey:

- (void) windowDidResignKey: (NSNotification*)aNotification;


windowDidResignMain:

- (void) windowDidResignMain: (NSNotification*)aNotification;


windowDidResize:

- (void) windowDidResize: (NSNotification*)aNotification;


windowDidUpdate:

- (void) windowDidUpdate: (NSNotification*)aNotification;


windowShouldClose:

- (BOOL) windowShouldClose: (id)sender;


windowShouldZoom:toFrame:

- (BOOL) windowShouldZoom: (NSWindow*)sender toFrame: (NSRect)aFrame;


windowWillClose:

- (void) windowWillClose: (NSNotification*)aNotification;


windowWillMiniaturize:

- (void) windowWillMiniaturize: (NSNotification*)aNotification;


windowWillMove:

- (void) windowWillMove: (NSNotification*)aNotification;


windowWillResize:toSize:

- (NSSize) windowWillResize: (NSWindow*)sender toSize: (NSSize)frameSize;


windowWillReturnFieldEditor:toObject:

- (id) windowWillReturnFieldEditor: (NSWindow*)sender toObject: (id)client;


windowWillUseStandardFrame:defaultFrame:

- (NSRect) windowWillUseStandardFrame: (NSWindow*)sender defaultFrame: (NSRect)aFrame;


Software documentation for the NSWindow(GNUstepBackend) category

NSWindow(GNUstepBackend)

Declared: AppKit/NSWindow.h

_captureMouse:

- (void) _captureMouse: (id)sender;


_initDefaults

- (void) _initDefaults;


_releaseMouse:

- (void) _releaseMouse: (id)sender;


_setVisible:

- (void) _setVisible: (BOOL)flag;


Software documentation for the NSWindow(GNUstepTextView) category

NSWindow(GNUstepTextView)

Declared: AppKit/NSWindow.h

_futureFirstResponder

- (id) _futureFirstResponder;