A set of optional methods that a delegate of NSWindow
can implement to respond to events, such as window resizing, moving, exposing, and minimizing.
SDK
- macOS 10.6+
Framework
- App
Kit
Declaration
protocol NSWindowDelegate
A set of optional methods that a delegate of NSWindow
can implement to respond to events, such as window resizing, moving, exposing, and minimizing.
SDK
Framework
protocol NSWindowDelegate
func window(NSWindow, will Position Sheet: NSWindow, using: NSRect) -> NSRect
Tells the delegate that the window is about to show a sheet at the specified location, giving it the opportunity to return a custom location for the attachment of the sheet to the window.
func window Will Begin Sheet(Notification)
Notifies the delegate that the window is about to open a sheet.
func window Did End Sheet(Notification)
Tells the delegate that the window has closed a sheet.
func window Will Resize(NSWindow, to: NSSize) -> NSSize
Tells the delegate that the window is being resized (whether by the user or through one of the set
methods other than set
).
func window Did Resize(Notification)
Tells the delegate that the window has been resized.
func window Will Start Live Resize(Notification)
Tells the delegate that the window is about to be live resized.
func window Did End Live Resize(Notification)
Tells the delegate that a live resize operation on the window has ended.
func window Will Miniaturize(Notification)
Tells the delegate that the window is about to be minimized.
func window Did Miniaturize(Notification)
Tells the delegate that the window has been minimized.
func window Did Deminiaturize(Notification)
Tells the delegate that the window has been deminimized.
func window Will Use Standard Frame(NSWindow, default Frame: NSRect) -> NSRect
Called by NSWindow
’s zoom(_:)
method while determining the frame a window may be zoomed to.
func window Should Zoom(NSWindow, to Frame: NSRect) -> Bool
Asks the delegate whether the specified window should zoom to the specified frame.
func window(NSWindow, will Use Full Screen Content Size: NSSize) -> NSSize
Called to allow the delegate to modify the full-screen content size.
func window(NSWindow, will Use Full Screen Presentation Options: NSApplication .Presentation Options) -> NSApplication .Presentation Options
Returns the presentation options the window uses when transitioning to full-screen mode.
func window Will Enter Full Screen(Notification)
The window is about to enter full-screen mode.
func window Did Enter Full Screen(Notification)
The window has entered full-screen mode.
func window Will Exit Full Screen(Notification)
The window is about to exit full-screen mode.
func window Did Exit Full Screen(Notification)
The window has left full-screen mode.
func custom Windows To Enter Full Screen(for: NSWindow) -> [NSWindow]?
Called when the window is about to enter full-screen mode.
func custom Windows To Enter Full Screen(for: NSWindow, on: NSScreen) -> [NSWindow]?
Called when the window is about to enter full-screen mode.
func window(NSWindow, start Custom Animation To Enter Full Screen With Duration: Time Interval)
This method is called to start the window animation into full-screen mode, including transitioning to a new space.
func window(NSWindow, start Custom Animation To Enter Full Screen On: NSScreen, with Duration: Time Interval)
This method is called to start the window animation into full-screen mode, including transitioning to a new space.
func window Did Fail To Enter Full Screen(NSWindow)
Called if the window failed to enter full-screen mode.
func custom Windows To Exit Full Screen(for: NSWindow) -> [NSWindow]?
Called when the window is about to exit full-screen mode.
func window(NSWindow, start Custom Animation To Exit Full Screen With Duration: Time Interval)
This method is called to start the window animation out of full-screen mode, including transitioning back to the desktop space.
func window Did Fail To Exit Full Screen(NSWindow)
Called if the window failed to exit full-screen mode.
func window Will Move(Notification)
Tells the delegate that the window is about to move.
func window Did Move(Notification)
Tells the delegate that the window has moved.
func window Did Change Screen(Notification)
Tells the delegate that the window has changed screens.
func window Did Change Screen Profile(Notification)
Tells the delegate that the window has changed screen display profiles.
func window Did Change Backing Properties(Notification)
Tells the delegate that the window backing properties changed.
func window Should Close(NSWindow) -> Bool
Tells the delegate that the user has attempted to close a window or the window has received a perform
message.
func window Will Close(Notification)
Tells the delegate that the window is about to close.
func window Did Become Key(Notification)
Tells the delegate that the window has become the key window.
func window Did Resign Key(Notification)
Tells the delegate that the window has resigned key window status.
func window Did Become Main(Notification)
Tells the delegate that the window has become main.
func window Did Resign Main(Notification)
Tells the delegate that the window has resigned main window status.
func window Will Return Field Editor(NSWindow, to: Any?) -> Any?
Tells the delegate that the field editor for a text-displaying object has been requested.
func window Did Update(Notification)
Tells the delegate that the window received an update()
message.
func window Did Expose(Notification)
Tells the delegate that the window has been exposed.
func window Did Change Occlusion State(Notification)
Tells the delegate that the window changed its occlusion state.
func window(NSWindow, should Drag Document With: NSEvent, from: NSPoint, with: NSPasteboard) -> Bool
Asks the delegate whether a user can drag the document icon from the window’s title bar.
func window Will Return Undo Manager(NSWindow) -> Undo Manager?
Tells the delegate that the window’s undo manager has been requested. Returns the appropriate undo manager for the window.
func window(NSWindow, should Pop Up Document Path Menu: NSMenu) -> Bool
Asks the delegate whether the window displays the title pop-up menu in response to a Command-click or Control-click on its title.
func window(NSWindow, will Encode Restorable State: NSCoder)
Tells the delegate the window is about to add its restorable state to a given archiver.
func window(NSWindow, did Decode Restorable State: NSCoder)
Tells the delegate the window is has extracted its restorable state from a given archiver.
func window(NSWindow, will Resize For Version Browser With Max Preferred Size: NSSize, max Allowed Size: NSSize) -> NSSize
Tells the delegate the window will resize for presentation during version browsing.
func window Will Enter Version Browser(Notification)
Tells the delegate the window is about to enter version browsing.
func window Did Enter Version Browser(Notification)
Tells the delegate that the window has entered version browsing.
func window Will Exit Version Browser(Notification)
Tells the delegate that the window is about to leave version browsing.
func window Did Exit Version Browser(Notification)
Tells the delegate that the window has left version browsing.
class NSWindow
A window that an app displays on the screen.
class NSPanel
A special kind of window that typically performs a function that is auxiliary to the main window.
class NSWindow Tab
A tab associated with a window that is part of a tabbing group.
class NSWindow Tab Group
A group of windows that display together as a single tabbed window.