cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:
調査中
-(NSRect)cellFrameForTextContainer:(NSTextContainer *)textContainer: proposedLineFragment:(NSRect)lineFrag: glyphPosition:(NSPoint)position: characterIndex:(unsigned)charIndex:
解説
テキストアタッチメントセルのフレームを返します。
返り値
( NSRect )
矩形
引数
( NSTextContainer * )textContainer
テキストコンテナ
( NSRect )lineFrag
矩形
( NSPoint )position
位置
( unsigned )charIndex
フレームワーク
ApplicationKit
クラス
NSTextAttachmentCell
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //テキストアタッチメント NSTextAttachment *theAttachment; NSRect rect; //ファイルラッパ NSFileWrapper *theWrapper = [[[NSFileWrapper alloc] initWithPath: [[NSBundle mainBundle] pathForResource:@"image" ofType:@"tiff"]] autorelease]; //テキストアタッチメント theAttachment = [[[NSTextAttachment alloc] initWithFileWrapper:theWrapper] autorelease]; // [[myOutlet textStorage] appendAttributedString: [NSAttributedString attributedStringWithAttachment:theAttachment]]; rect = [[theAttachment attachmentCell] cellFrameForTextContainer:[myOutlet textContainer] proposedLineFragment:NSMakeRect(0,0,50,50) glyphPosition:NSMakePoint(30,30) characterIndex:1 ]; NSLog([NSString stringWithFormat:@"cellFrameForTextContainer %f,%f,%f,%f",rect.origin.x,rect.origin.y,rect.size.width,rect.size.height]); } @end