• 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
NSTextAttachment display problems on 10.2?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextAttachment display problems on 10.2?


  • Subject: NSTextAttachment display problems on 10.2?
  • From: Glen Simmons <email@hidden>
  • Date: Wed, 6 Oct 2004 09:55:36 -0500

I'm using (abusing?) an NSTextView to display a series of small graphics (57 x 36 pixels, to be exact). I'm using the following code to create the NSTextAttachment and insert it:

NSString *imagePath = [[NSBundle mainBundle] pathForResource:imageName
ofType:@"png"
inDirectory:@"Key History Images"];
NSFileWrapper *theWrapper = [[NSFileWrapper alloc] initWithPath: imagePath];
NSTextAttachment *theAttachment = [[NSTextAttachment alloc] initWithFileWrapper:theWrapper];
NSAttributedString *theAttrStr = [NSAttributedString attributedStringWithAttachment:theAttachment];
[textViewOutlet insertText:theAttrStr];

(Code simplified for posting; yes, I release things properly)

This works fine on 10.3, but on 10.2, the images overlap vertically, like the NSTextView is not setting the line height properly. Oddly enough, this problem doesn't appear if the images are drag-n-dropped into the text view or if they are copy/pasted in. Should I be inserting the images another way? Is there a workaround for this?

Thanks,
Glen Simmons

_______________________________________________
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
  • Prev by Date: Help With NSURLConnection Authentication
  • Next by Date: Re: NSImage in a NSMenuItem?
  • Previous by thread: Re: Help With NSURLConnection Authentication
  • Next by thread: Re: NSImage in a NSMenuItem?
  • Index(es):
    • Date
    • Thread