attachmentCell
ハンドルマウスイベントにアイコンを描くために使用されるオブジェクトを返します
解説
ハンドルマウスイベントにアイコンを描くために使用されるオブジェクトを返します。
NSTextAttachmentは、デフォルトでファイルが画像を含むなら、添付ファイルのアイコンまたはその内容を表示するNSTextAttachmentCellを使います。
返り値
( id <NSTextAttachmentCell> )
オブジェクト
引数
フレームワーク
ApplicationKit
クラス
NSTextAttachment
Instance Methods
使用可能
10.0
参照
- fileWrapper
- image (NSCell)
- icon (NSFileWrapper)
- setAttachmentCell:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //テキストアタッチメント NSTextAttachment *theAttachment; NSTextAttachmentCell *bCell = [[[NSTextAttachmentCell alloc] initImageCell:nil] autorelease]; //ファイルラッパ //テキストアタッチメント theAttachment = [[[NSTextAttachment alloc] init] autorelease]; [theAttachment setAttachmentCell:bCell]; NSLog([[theAttachment attachmentCell] className]); // [[myOutlet textStorage] appendAttributedString: [NSAttributedString attributedStringWithAttachment:theAttachment]]; } @end