NSTextAttachment display problems on 10.2?
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