context
アプリケーションのディスプレイコンテキストを返します
@property(readonly, strong) NSGraphicsContext *context
var context: NSGraphicsContext? { get }
解説
アプリケーションのディスプレイコンテキストを返します。
フレームワーク
ApplicationKit
クラス
NSApplication
使用可能
10.0
編集時のバージョン
10.10
参照
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { NSGraphicsContext *context = [NSApp context]; NSLog(@"context %@",[context description]); NSLog(@"%p",[context focusStack]); } @end
//NSApplication aContext @IBAction func function059(sender: AnyObject) { //共有アプリケーションインスタンスを取得 let anApplication = MyApplication.sharedApplication() var aContext : NSGraphicsContext = anApplication.context! NSLog("context = %@",aContext) var point : NSPoint = aContext.patternPhase NSLog("%f,%f",point.x,point.y) }