convertRect:fromView:
別のビューの座標をレシーバの座標へ変換してNSRectを返します
-(NSRect)convertRect:(NSRect)aRect:
fromView:(NSView *)aView:
解説
別のビュー(aView)の座標をレシーバの座標へ変換してNSRectを返します。
別のビュー(aView)がnilなら、ウインドウの座標になります。
別のビュー(aView)とレシーバーは、同じNSWindowにないといけません。
返り値
( NSRect )
aViewのレシーバでのRect
引数
( NSRect )aRect
変換元の範囲
( NSView * )aView
変換元のビュー
フレームワーク
ApplicationKit
クラス
NSView
Instance Methods
使用可能
10.0
参照
- convertPoint:fromView:
- convertSize:fromView:
- ancestorSharedWithView:
- contentView (NSWindow)
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { [info setIntValue:[sender convertRect:NSMakeRect(1.0,1.0,10.0,10.0) fromView:nil].origin.x]; } @end