Re: NSTextAttachment behavior
Re: NSTextAttachment behavior
- Subject: Re: NSTextAttachment behavior
- From: Douglas Davidson <email@hidden>
- Date: Fri, 14 Jan 2005 10:09:31 -0800
On Jan 14, 2005, at 9:59 AM, Frank Midgley wrote:
First get the icon for the file from NSWorkspace. Then create an
NSTextAttachment, get its cell and call -setImage: on it with the
file's icon.
It's probably better to create a new cell yourself rather than letting
NSTextAttachment create one automatically and then trying to modify it.
First, it avoids the expense of having NSTextAttachment examine the
file contents and create an image or other resource from them, just to
discard it. Second, there's no telling what kind of NSCell subclass
NSTextAttachment will use; it depends entirely on what NSTextAttachment
thinks your file contains. If you create your own cell, you can just
make it an NSTextAttachmentCell and you'll be fine.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden