glyphIndexForPoint:inTextContainer:
テキストコンテナの範囲で指定した位置にもっとも近い文字の番号を返します
-(unsigned int)glyphIndexForPoint:(NSPoint)aPoint: inTextContainer:(NSTextContainer *)aTextContainer:
解説
テキストコンテナの範囲で指定した位置にもっとも近い文字の番号を返します。
aPointはテキストコンテナでの座標。
返り値
( unsigned int )
整数値
引数
( NSPoint )aPoint
位置
( NSTextContainer * )aTextContainer
テキストコンテナ
フレームワーク
ApplicationKit
クラス
NSLayoutManager
Instance Methods
使用可能
10.0
参照
- fractionOfDistanceThroughGlyphForPoint:inTextContainer:
例文
glyphIndex = [layoutManager glyphIndexForPoint:point inTextContainer:textContainer]; //指定したポイントのグリフインデックスを返します //マウスクリックした時にどの文字を選択するかの時に使われます - (unsigned)glyphIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container fractionOfDistanceThroughGlyph:(float *)partialFraction { NSLog(NSLocalizedString( @"LM00017", @""),point.x,point.y) ; return [super glyphIndexForPoint:point inTextContainer:container fractionOfDistanceThroughGlyph:partialFraction]; }