mouse:inRect:
レシーバのビューの指定した範囲に指定した位置が含まれているかを返します
-(BOOL)mouse:(NSPoint)aPoint: inRect:(NSRect)aRect:
解説
レシーバのビューの指定した範囲に指定した位置が含まれているかを返します。
返り値
( BOOL )
YES/NO
引数
( NSPoint )aPoint
位置
( NSRect )aRect
範囲
フレームワーク
ApplicationKit
クラス
NSView
Instance Methods
使用可能
10.0
参照
- hitTest:
- isFlipped
NSMouseInRect() (Foundation Functions)
- convertPoint:fromView:
例文
#import "MyScrollView.h" @implementation MyScrollView - (void)mouseDown:(NSEvent *)theEvent { if ([self mouse:[theEvent locationInWindow] inRect:[self frame]]) { NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end