macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

convertBaseToScreen:

INDEX>AppKit> NSWindow

ウインドウの座標位置をスクリーンの座標位置に変換して返します

Objective-C

- (NSPoint)convertBaseToScreen:(NSPoint)point

Swift
なし

-(NSPoint)convertBaseToScreen:(NSPoint)aPoint:

解説

ウインドウの座標位置をスクリーンの座標位置に変換して返します。

返り値

( NSPoint )

スクリーンの座標位置

引数

( NSPoint )aPoint

ウインドウの座標位置

フレームワーク

ApplicationKit

クラス

NSWindow

使用可能

10.0-10.7

関連記事(外部サイト)

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
NSPoint convertPoint;

convertPoint = [myWindow convertBaseToScreen:NSMakePoint(0.0,0.0)];

[info setStringValue:[NSString stringWithFormat:@"%.1f,%.1f",convertPoint.x,convertPoint.y]];

}
@end

更新時のバージョン

OS X 10.10