NSWindowクラス
APPLE MacBook (1.1GHzデュアルコア Intel CoreMプロセッサ/12型/8GB/256GB/USB-C/ゴールド) MK4M2J/A
- 出版社/メーカー: アップル
- 発売日: 2015/04/11
- メディア: Personal Computers
- この商品を含むブログ (2件) を見る
ウインドウのクラスです
継承 | NSObject |
準拠 | NSObject (NSObject) |
フレームワーク | /System/Library/Frameworks/AppKit.framework |
使用可能 | OS X 10.0以降 |
定義 | @import AppKit; |
概要
ウインドウのクラスです。
ウインドウを作成する場合通常はXibから読み込むのですが、コードで作成することも出来ます。
Swift
var window : NSWindow = NSWindow(contentRect: NSMakeRect(0, 0, 800, 600), styleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask, backing: .Buffered, defer: false) windowArray.addObject(window) window.makeKeyAndOrderFront(self)
ウインドウを作成するには(initWithContentRect:styleMask:backing:defer: )を使用します。
Swiftでは(init )を使用します。
メソッドとプロパティ
ウインドウの作成
initWithContentRect:styleMask:backing:defer:
10.0- ウインドウを初期化して返します
initWithContentRect:styleMask:backing:defer:screen:
10.0- スクリーンを指定してウインドウを初期化して返します
ウインドウの設定
styleMask
10.0- ウインドウのスタイル
setStyleMask:
10.0- styleMaskを使います。
toggleFullScreen:
10.7-フルスクリーンモードの切り替え
worksWhenModal
10.0- モーダルで動いているウインドウがある場合、キーボードイベントやマウスイベントを受け取ることができるかどうか
alphaValue
10.0- 透明度(アルファ値)
backgroundColor
背景色
setBackgroundColor:
背景色の設定。backgroundColorを使用してください。
colorSpace
カラースペース
setColorSpace:
カラースペースのセットcolorSpaceを使ってください。
contentView
内容ビュー
setContentView:
内容ビューのセット。contentViewを使ってください。
canHide
アプリケーションを隠したとき、ウインドウは隠されるか
setCanHide:
アプリケーションを隠したとき、ウインドウは隠されるかどうかのセット。canHideを使ってください。
canBeVisibleOnAllSpaces
10.5-10.5
setCanBeVisibleOnAllSpaces:
10.5-10.5
isOnActiveSpace
10.6-10.9
hidesOnDeactivate
10.0- ウインドウがアクティブでなくなった時に表示するか
setHidesOnDeactivate:
hidesOnDeactivateを使用します。
collectionBehavior
setCollectionBehavior:
collectionBehaviorを使ってください。
isOpaque
10.0-10.9
setOpaque:
ウインドウを不透明にするかセットします
hasShadow
ウインドウに影があるかどうか
setHasShadow:
hasShadowを使います。
invalidateShadow
10.2- 【調査中】ウインドウの形状に基づいて影を計算する
autorecalculatesContentBorderThicknessForEdge:
10.5- 【調査中】境界線の太さを自動計算しているか
setAutorecalculatesContentBorderThickness:forEdge:
contentBorderThicknessForEdge:
【調査中】ウインドウの境界線
setContentBorderThickness:forEdge:
delegate
10.0- ウインドウのデリゲート
setDelegate:
delegateを使います。
preventsApplicationTerminationWhenModal
10.6- ウインドウがモーダルの時に、終了を防ぐかどうか
setPreventsApplicationTerminationWhenModal:
ウインドウ情報へのアクセス
defaultDepthLimit
10.0- 初期設定のウインドウ色深度制限を返します。
windowNumber
10.0- ウインドウデバイスの番号
windowNumbersWithOptions:
10.6- オプション付きでウインドウ番号を返します
gState
10.0-10.10
canStoreColor
10.1-10.10
deviceDescription
10.0- デバイス情報
canBecomeVisibleWithoutLogin
10.5- ログインウインドウで表示されるか
setCanBecomeVisibleWithoutLogin:
canBecomeVisibleWithoutLoginを使用してください。
sharingType
10.5- 共有タイプ
setSharingType:
sharingTypeを使用してください。
backingType
10.5- 保持のタイプ
setBackingType:
backingTypeを使います。
backingLocation
10.5- 保持の場所
preferredBackingLocation
10.5- ウインドウのバッキングストア保持の優先位置
setPreferredBackingLocation:
preferredBackingLocationを使用してください。
isOneShot
10.0-10.9oneShot を使用
oneShot
10.0- ウインドウが閉じるとき、メモリを解放するかどうか
depthLimit
10.0- ウインドウの色深度制限
setDepthLimit:
hasDynamicDepthLimit
10.0- ウインドウは、スクリーンに合わせて色深度を制限するかを返します
setDynamicDepthLimit:
10.0- ウインドウは、スクリーンに合わせて色深度を制限するかをセットします
レイアウト情報の取得
contentRectForFrameRect:styleMask:
10.0- フレームからスタイルを引いた内容だけの矩形を返します
frameRectForContentRect:styleMask:
内容とスタイルを合計した矩形を返します 10,0-
minFrameWidthWithTitle:styleMask:
タイトルとスタイルを全て表示できる幅を返します 10.0-
contentRectForFrameRect:
ウインドウの内容矩形のスクリーン座標とサイズを返します
frameRectForContentRect:
内容とスタイルを合計した矩形を返します 10.3-
ウインドウの管理
drawers
ウインドウに付いている引き出しを配列で返します 10.0-
windowController
ウインドウのウインドウコントローラー
setWindowController:
【調査中】ウインドウコントローラーをセットする
シートの管理
attachedSheet
ウインドウに付けられたシート 10.1-
isSheet
シートかどうか 10.1-10.9
beginSheet:completionHandler:
シートを開始します 10.9-
beginCriticalSheet:completionHandler:
優先のシートを表示します 10.9-
endSheet:
シートを終了します 10.9-
endSheet:returnCode:
シートを終了します 10.9-
sheetParent
シートの親ウインドウ 10.9-
sheets
ウインドウに付いているシート 10.9-
ウインドウのサイズ
frame
ウインドウのフレーム矩形をスクリーン座標で返す 10.0-
setFrameOrigin:
ウインドウフレームの起点をセットします 10.0-
setFrameTopLeftPoint:
ウインドウの左上の位置をセットします 10.0-
constrainFrameRect:toScreen:
ウインドウの位置を調整するメソッド 10.0-
cascadeTopLeftFromPoint:
カスケード配置する(少しずつずらしながら表示する)ための次の位置を返します 10.0-
setFrame:display:
ウインドウフレームをセットします 10.0-
setFrame:display:animate:
ウインドウフレームをセットします(アニメーション移動)10.0-
animationResizeTime:
ウインドウをリサイズするときのアニメーションの速度を返します 10.0-
aspectRatio
アスペクト比
setAspectRatio:
アスペクト比をセットします。aspectRatioを使ってください。
minSize
ウインドウの最小サイズ 10.0-
setMinSize:
ウインドウの最小サイズをセットします。minSizeを使用
maxSize
ウインドウの最大サイズ
setMaxSize:
ウインドウの最大サイズをセットします。maxSizeを使用
isZoomed
非推奨10.0-10.9
performZoom:
ズームボタンを押す動作をします 10.0-
zoom:
ズームします 10.0-
resizeFlags
どのモディファイアキーが押されているかを返します 10.0-
showsResizeIndicator
リサイズインジケータ(ウインドウ右下の三角)の表示 10.0-
setShowsResizeIndicator:
リサイズインジケータ(ウインドウ右下の三角)の表示をセットするshowsResizeIndicatorを使用
resizeIncrements
リサイズするときの変化量を返します 10.0-
setResizeIncrements:
リサイズするときの増加量を返しますresizeIncrementsを使用
preservesContentDuringLiveResize
調査中 10.4-
setPreservesContentDuringLiveResize:
調査中preservesContentDuringLiveResizeを使用 10.4-
inLiveResize
現在ライブラリサイズ中かどうか 10.6-
ウインドウ内容のサイズ
contentAspectRatio
アスペクト比 10.3-
setContentAspectRatio:
アスペクト比をセットします。contentAspectRatioを使用10.3-
contentMinSize
ウインドウの内容の最小サイズ 10.3-
setContentMinSize:
ウインドウの内容の最小サイズをセットします、contentMinSizeを使用 10.3-
setContentSize:
contentMaxSize
ウインドウの内容(タイトルバーを除いた)最大サイズを返します 10.3-
setContentMaxSize:
ウインドウの内容(タイトルバーを除いた)最大サイズをセットしますcontentMaxSizeを使用 10.3-
contentResizeIncrements
ウインドウのコンテンツをサイズ変更するときの増減数を返します 10.3-
setContentResizeIncrements:
ウインドウのコンテンツをサイズ変更するときの増減数をセットします contentResizeIncrementsを使用
ウインドウレイヤーの管理
orderOut:
ウインドウを表示しなくなりますでもメモリは解放しません 10.0-
orderBack:
キーウインドウ、メインウインドウはそのままでウインドウを後ろにやります 10.0-
orderFront:
キーウインドウ、メインウインドウはそのままでウインドウを前面に出します 10.0-
orderFrontRegardless
アプリケーションがアクティブでなくてもウインドウを前面に持ってきます 10.0-
orderWindow:relativeTo:
ウインドウの前後の位置をセットします
level
ウインドウの前後関係の位置 10.0-
setLevel:
ウインドウの前後関係の位置をセットしますlevelを使用
ウインドウの表示状態の管理
isVisible
非推奨ウインドウは表示されているかどうかocclusionStateを使用 10.0-10.9
occlusionState
ウインドウが他のウインドウなどによってすべて隠れている状態かどうか 10.9-
ユーザーデフォルトでのウインドウフレームの管理
removeFrameUsingName:
ユーザーデフォルトに保存したウインドウの位置とサイズ情報を削除します 10.0-
setFrameUsingName:
指定したフレーム名でユーザーデフォルトに保存されている設定をセットします 10.0-
setFrameUsingName:force:
【調査中】指定したフレーム名でユーザーデフォルトに保存されている設定をセットします10.1-
saveFrameUsingName:
指定した名前でウインドウフレームをユーザーデフォルトに保存します 10.0-
frameAutosaveName
フレームの自動保存名を返します 10.0-
setFrameAutosaveName:
フレームの自動保存名を指定した名前にセットします10.0-
stringWithSavedFrame
レシーバのフレームを表現した文字列を返します 10.0-
setFrameFromString:
フレーム名をセットします 10.0-
キー状態の管理
isKeyWindow
非推奨10.0-10.9
canBecomeKeyWindow
ウインドウはキーウインドウに成ることができるか 10.0-
makeKeyWindow
キーウインドウにします 10.0-
makeKeyAndOrderFront:
キーウインドウにして前面に持ってきます 10.0-
becomeKeyWindow
キーウインドウになったら、自動的に呼び出される。サブクラスでオーバーライドします
resignKeyWindow
ウインドウがキーウインドウでなくなるときに呼び出されます、サブクラスでオーバーライドします。
メイン状態の管理
isMainWindow
非推奨10.0-10.9
canBecomeMainWindow
メインウインドウになることができるかを返します10.0-
makeMainWindow
メインウインドウにします10.0-
becomeMainWindow
メインウインドウになる時に呼び出されます10.0-
resignMainWindow
メインウインドウでなくなるときに呼び出されます 10.0-
ツールバーの管理
toolbar
ウインドウのツールバー 10.0-
setToolbar:
ウインドウのツールバーをセットしますtoolbarを使用 10.0-
toggleToolbarShown:
ツールバーの表示・非表示を切り替えます。10.1-
runToolbarCustomizationPalette:
ツールバーをカスタマイズするパレットの表示 10.1-
アタッチウインドウの管理
childWindows
子ウインドウを配列で返します 10.2-
addChildWindow:ordered:
ウインドウに子ウインドウを追加します 10.2-
removeChildWindow:
ウインドウと子ウインドウの連結を解除します 10.2-
parentWindow
親ウインドウ 10.2-
setParentWindow:
親ウインドウをセットしますparentWindowを使用 10.2-
ウインドウバッファの管理
isFlushWindowDisabled
ウインドウが描き変わるかを返します 10.0-10.9
enableFlushWindow disableFlushWindow()と対で使用 -10.0
ウインドウが描き変わるようにします 10.0-
disableFlushWindow
ウインドウが描き変わらないようにします。enableFlushWindow と対で使用10.0-
flushWindow
ウインドウのオフスクリーンバッファを消去します 10.0-
flushWindowIfNeeded
ウインドウのオフスクリーンバッファを消去します 10.0-
デフォルトボタンの管理
defaultButtonCell
デフォルトボタンセルを返します 10.0-
setDefaultButtonCell:
デフォルトボタンセルをセットします 10.0-
enableKeyEquivalentForDefaultButtonCell
【調査中】デフォルトボタンを使用可能にします 10.0-
disableKeyEquivalentForDefaultButtonCell
【調査中】デフォルトボタンセルの代替キーを使用不能にします。 10.0-
フィールドエディタの管理
ウインドウメニューの管理
isExcludedFromWindowsMenu
Available in OS X v10.0 through OS X v10.9
setExcludedFromWindowsMenu:
カーソル矩形の管理
areCursorRectsEnabled
enableCursorRects
disableCursorRects
discardCursorRects
invalidateCursorRectsForView:
resetCursorRects
タイトルバーの管理
standardWindowButton:forStyleMask:
standardWindowButton:
showsToolbarButton
setShowsToolbarButton:
イベントの取り扱い
menuChanged:
currentEvent
nextEventMatchingMask:
nextEventMatchingMask:untilDate:inMode:dequeue:
discardEventsMatchingMask:beforeEvent:
postEvent:atStart:
sendEvent:
tryToPerform:with:
キービューループの管理
selectKeyViewPrecedingView:
selectKeyViewFollowingView:
selectPreviousKeyView:
selectNextKeyView:
keyViewSelectionDirection
autorecalculatesKeyViewLoop
recalculateKeyViewLoop
setAutorecalculatesKeyViewLoop:
キーボードイベントの取り扱い
マウスイベントの取り扱い
acceptsMouseMovedEvents
ignoresMouseEvents
setIgnoresMouseEvents:
mouseLocationOutsideOfEventStream
setAcceptsMouseMovedEvents:
windowNumberAtPoint:belowWindowWithWindowNumber:
ウインドウリストアの管理
setRestorable:
isRestorable
Available in OS X v10.7 through OS X v10.9
setRestorationClass:
restorationClass
disableSnapshotRestoration
enableSnapshotRestoration
Bracketing Drawing Operations
ウインドウの描画
display
displayIfNeeded
viewsNeedDisplay
setViewsNeedDisplay:
isAutodisplay
Available in OS X v10.0 through OS X v10.9
setAutodisplay:
useOptimizedDrawing:
(OS X v10.10)
graphicsContext
allowsConcurrentViewDrawing
setAllowsConcurrentViewDrawing:
Window Animation
Updating Windows
アイテムのドラッグ
dragImage:at:offset:event:pasteboard:source:slideBack:
registerForDraggedTypes:
unregisterDraggedTypes
座標の変換
backingScaleFactor
backingAlignedRect:options:
convertRectFromBacking:
convertRectToBacking:
convertRectToScreen:
convertRectFromScreen:
convertBaseToScreen:
(OS X v10.7)
convertScreenToBase:
(OS X v10.7)
userSpaceScaleFactor
(OS X v10.7)
Accessing Edited Status
isDocumentEdited
Available in OS X v10.0 through OS X v10.9
setDocumentEdited:
タイトルの管理
title
setTitle:
setTitleWithRepresentedFilename:
representedFilename
setRepresentedFilename:
representedURL
setRepresentedURL:
Accessing Screen Information
screen
deepestScreen
displaysWhenScreenProfileChanges
setDisplaysWhenScreenProfileChanges:
ウインドウの移動
isMovableByWindowBackground
Available in OS X v10.2 through OS X v10.9
setMovableByWindowBackground:
isMovable
Available in OS X v10.6 through OS X v10.9
setMovable:
center
Closing Windows
performClose:
close
isReleasedWhenClosed
Available in OS X v10.0 through OS X v10.9
setReleasedWhenClosed:
ウインドウの最小化
isMiniaturized
Available in OS X v10.0 through OS X v10.9
performMiniaturize:
miniaturize:
deminiaturize:
miniwindowImage
setMiniwindowImage:
miniwindowTitle
setMiniwindowTitle:
Getting the Dock Tile
ウインドウのプリント
Working with Carbon
Triggering Constraint-Based Layout
Debugging Constraint-Based Layout
Constraint-Based Layouts
anchorAttributeForOrientation:
setAnchorAttribute:forOrientation:
データタイプ
NSWindowDepth—Window Depth
定数
Window Style Masks
Window Levels
Display Device—Descriptions
Managing Scaling Factors
Controlling the Look of a Window and Its Toolbar
Supporting Full Screen Appearance
NSSelectionDirection—Direction of Key View Change
NSWindowButton
NSRunLoop—Ordering Modes for NSWindow
Explicit Window Depth Limits
NSBackingStoreType—Buffered Window Drawing
NSWindowOrderingMode
NSWindowSharingType
NSWindowBackingLocation
NSWindowNumberListOptions
NSWindowAnimationBehavior
Managing Window Collections
NSWindowOcclusionState
Additional NSModalResponse Values
Application Kit Version for Deferred Window Display Support
Application Kit Version for Custom Sheet Position
NSWindowDidChangeBackingPropertiesNotification User Info Properties
Notifications
NSWindowDidBecomeKeyNotification
NSWindowDidBecomeMainNotification
NSWindowDidChangeScreenNotification
NSWindowDidChangeScreenProfileNotification
NSWindowDidDeminiaturizeNotification
NSWindowDidEndSheetNotification
NSWindowDidEndLiveResizeNotification
NSWindowDidExposeNotification
NSWindowDidMiniaturizeNotification
NSWindowDidMoveNotification
NSWindowDidResignKeyNotification
NSWindowDidResignMainNotification
NSWindowDidResizeNotification
NSWindowDidUpdateNotification
NSWindowWillBeginSheetNotification
NSWindowWillCloseNotification
NSWindowWillMiniaturizeNotification
NSWindowWillMoveNotification
NSWindowWillStartLiveResizeNotification
NSWindowWillEnterFullScreenNotification
NSWindowDidEnterFullScreenNotification
NSWindowWillExitFullScreenNotification
NSWindowDidExitFullScreenNotification
NSWindowWillEnterVersionBrowserNotification
NSWindowDidEnterVersionBrowserNotification
NSWindowWillExitVersionBrowserNotification
NSWindowDidExitVersionBrowserNotification
NSWindowDidChangeBackingPropertiesNotification
NSWindowDidChangeOcclusionStateNotification
すでに非推奨
setAlphaValue:
10.0 透明度のセット。alphaValueを使って下さい。