• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextAttachment behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTextAttachment behavior
      • From: Gwynne <email@hidden>
References: 
 >NSTextAttachment behavior (From: Gwynne <email@hidden>)
 >Re: NSTextAttachment behavior (From: Frank Midgley <email@hidden>)

  • Prev by Date: Re: NSTextAttachment behavior
  • Next by Date: Re: Convert String into Expression
  • Previous by thread: Re: NSTextAttachment behavior
  • Next by thread: Re: NSTextAttachment behavior
  • Index(es):
    • Date
    • Thread