NSWindowDelegate 关于窗口大小 位置 显示 等api说明

来源:互联网 发布:tensorflow 指定显卡 编辑:程序博客网 时间:2024/05/17 07:57

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSWindowDelegate_Protocol/#//apple_ref/occ/intfm/NSWindowDelegate/windowDidBecomeMain:


NSWindowDelegate

Inherits From


  • NSObject

Conforms To


Not Applicable

Import Statement


OBJECTIVE-C

@import AppKit;

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.

Managing Sheets

  • - window:willPositionSheet:usingRect:
  • - windowWillBeginSheet:
  • - windowDidEndSheet:

Sizing Windows

  • - windowWillResize:toSize:
  • - windowDidResize:
  • - windowWillStartLiveResize:
  • - windowDidEndLiveResize:

Minimizing Windows

  • - windowWillMiniaturize:
  • - windowDidMiniaturize:
  • - windowDidDeminiaturize:

Zooming Window

  • - windowWillUseStandardFrame:defaultFrame:
  • - windowShouldZoom:toFrame:

Managing Full-Screen Presentation

  • - window:willUseFullScreenContentSize:
  • - window:willUseFullScreenPresentationOptions:
  • - windowWillEnterFullScreen:
  • - windowDidEnterFullScreen:
  • - windowWillExitFullScreen:
  • - windowDidExitFullScreen:

Custom Full-Screen Presentation Animations

  • - customWindowsToEnterFullScreenForWindow:
  • - customWindowsToEnterFullScreenForWindow:onScreen:
  • - window:startCustomAnimationToEnterFullScreenWithDuration:
  • - window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:
  • - windowDidFailToEnterFullScreen:
  • - customWindowsToExitFullScreenForWindow:
  • - window:startCustomAnimationToExitFullScreenWithDuration:
  • - windowDidFailToExitFullScreen:

Moving Windows

  • - windowWillMove:
  • - windowDidMove:
  • - windowDidChangeScreen:
  • - windowDidChangeScreenProfile:
  • - windowDidChangeBackingProperties:

Closing Windows

  • - windowShouldClose:
  • - windowWillClose:

Managing Key Status

  • - windowDidBecomeKey:
  • - windowDidResignKey:

        [[NSNotificationCenterdefaultCenter] addObserver:

                                                 selector

                                                name:NSWindowDidResignKeyNotification

                                                   object:;


Managing Main Status

  • - windowDidBecomeMain:

    Tells the delegate that the window has become main.

    Declaration

    SWIFT

    optional func windowDidBecomeMain(_ notificationNSNotification)

    OBJECTIVE-C

    - (void)windowDidBecomeMain:(NSNotification *)notification

    Parameters

    notification

    A notification named NSWindowDidBecomeMainNotification.

    Discussion

    You can retrieve the window object in question by sending object to notification.

    Availability

    Available in OS X v10.0 and later.

    Available as part of an informal protocol prior to OS X v10.6.

    See Also

    – windowDidResignMain:

  • - windowDidResignMain:   

    Tells the delegate that the window has resigned main window status.

    Declaration

    SWIFT

    optional func windowDidResignMain(_ notificationNSNotification)

    OBJECTIVE-C

    - (void)windowDidResignMain:(NSNotification *)notification

    Parameters

    notification

    A notification named NSWindowDidResignMainNotification.

    Discussion

    You can retrieve the window object in question by sending object to notification.

    Availability

    Available in OS X v10.0 and later.

    Available as part of an informal protocol prior to OS X v10.6.

    See Also

    – windowDidBecomeMain:

Managing Field Editors

  • - windowWillReturnFieldEditor:toObject:

Updating Windows

  • - windowDidUpdate:

Exposing Windows

  • - windowDidExpose:

Managing Occlusion State

  • - windowDidChangeOcclusionState:

Dragging Windows

  • - window:shouldDragDocumentWithEvent:from:withPasteboard:

Getting the Undo Manager

  • - windowWillReturnUndoManager:

Managing Titles

  • - window:shouldPopUpDocumentPathMenu:

Managing Restorable State

  • - window:willEncodeRestorableState:
  • - window:didDecodeRestorableState:

Managing Presentation in Version Browsers

  • - window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:
  • - windowWillEnterVersionBrowser:
  • - windowDidEnterVersionBrowser:
  • - windowWillExitVersionBrowser:
  • - windowDidExitVersionBrowser:

0 0
原创粉丝点击