• 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: Frank Midgley <email@hidden>
  • Date: Fri, 14 Jan 2005 11:59:24 -0600


On Jan 14, 2005, at 11:53AM, Gwynne wrote:

The designated initializer for NSTextAttachment says this:

Initializes a newly allocated NSTextAttachment to contain aWrapper and use an NSTextAttachmentCell as its attachment cell. If aWrapper contains an image file that the receiver can interpret as an NSImage object, sets the attachment cell’s image to the NSImage rather than to the icon of aWrapper.

This is _almost_ what I want. But I want it to always use the file's icon, even if the file is an image. Is there a simple way to do this without sitting here reimplementing the entire NSTextAttachmentCell machinery?

I apologize if this is a FAQ, but I couldn't find any information about it with an archive/Google search.

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.


-Frank

------------------------------------
Frank M. Midgley
email@hidden
http://homepage.mac.com/knarf/

_______________________________________________
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: Douglas Davidson <email@hidden>
References: 
 >NSTextAttachment behavior (From: Gwynne <email@hidden>)

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