https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSWindowDelegate_Protocol/#//apple_ref/occ/intfm/NSWindowDelegate/windowDidBecomeMain:
NSWindowDelegate
Inherits From
Conforms To
Not Applicable
Import Statement
OBJECTIVE-C
Availability
Available in OS X v10.6 and later
The NSWindowDelegate protocol defines the methods that a delegate of NSWindow should implement. All methods in this protocol are optional.
By implementing these methods, the delegate may respond to window resizing, moving, exposing, minimizing, and a number of other window events.
-
- windowDidResignKey:[[NSNotificationCenter defaultCenter] addObserver:
selector
name:NSWindowDidResignKeyNotification
object:;
-
-
Tells the delegate that the window has become main.
Declaration
SWIFT
optional func windowDidBecomeMain(_notification: NSNotification)OBJECTIVE-C
- (void)windowDidBecomeMain:(NSNotification *)notification
Parameters
notificationA notification named
NSWindowDidBecomeMainNotification.Discussion
You can retrieve the window object in question by sending
objecttonotification.Availability
Available in OS X v10.0 and later.
Available as part of an informal protocol prior to OS X v10.6.
See Also
-
Tells the delegate that the window has resigned main window status.
Declaration
SWIFT
optional func windowDidResignMain(_notification: NSNotification)OBJECTIVE-C
- (void)windowDidResignMain:(NSNotification *)notification
Parameters
notificationA notification named
NSWindowDidResignMainNotification.Discussion
You can retrieve the window object in question by sending
objecttonotification.Availability
Available in OS X v10.0 and later.
Available as part of an informal protocol prior to OS X v10.6.
See Also
-
本文详细介绍了 NSWindowDelegate 协议的功能及其提供的多种方法,包括管理窗口表单、调整窗口大小、最小化窗口等操作。通过实现这些可选方法,开发者可以更好地控制应用程序中窗口的行为。
3576

被折叠的 条评论
为什么被折叠?



