Re: Attachment Cell with Image
Re: Attachment Cell with Image
- Subject: Re: Attachment Cell with Image
- From: Douglas Davidson <email@hidden>
- Date: Thu, 12 Oct 2006 11:03:18 -0700
On Oct 12, 2006, at 10:20 AM, Gerriet M. Denkmann wrote:
I have an NSTextView, where I add an NSTextAttachment which has an
NSTextAttachmentCell which has an NSImage.
I save this NSTextView and read it again.
The attachments are still there, but they all show the default file-
icon - not my NSImage.
NSTextAttachment fundamentally is designed to represent an attached
file. The persistent portion, the model part if you will, of an
NSTextAttachment is the file--that is, the NSTextAttachment's file
wrapper. The text attachment cell is merely a visual representation
of that file, the attachment's view portion. If you do not supply a
text attachment cell, NSTextAttachment will by default generate a
suitable text attachment cell from the file wrapper, based on its
understanding of file types, but it will not generate a file wrapper
from a cell in the reverse situation.
If you want your attachments to be persistent, choose a suitable file
type and supply a file wrapper with file contents and an appropriate
name. You may then also supply a custom attachment cell, if you
wish, to customize the visual representation of the attachment within
your application, but remember that other applications will use the
standard representation based on the attached file.
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