NSTextAttachment Problem
NSTextAttachment Problem
- Subject: NSTextAttachment Problem
- From: Jonathan Wight <email@hidden>
- Date: Mon, 14 Jul 2003 15:20:22 -0500
First Problem:
I've created an NSTextAttachment & NSTextAttachmentCell to add simple
non-file based attachments to an NSTextView.
I've overriden NSTextAttachmentCell's drawWithFrame:inView: method to do my
own drawing. In that method I am drawing a pre-loaded icon using NSImage's
drawInRect:fromRect:operation:fraction: method.
The image is drawing - but the only problem is that the image is upside
down! I've checked the rectangles I pass into drawInRect:fromRect:operation:
and they seem sane so I can only assume the view's NSAffineTransform matrix
has been vertically flipped.
Flipping the matrix back before my drawing doesn't produce a useful result
(the image doesn't get drawn or if it does its offscreen).
Has anyone seen anything like this problem before?
Second Problem:
If I ignore the upside drawing problem the next issue is that dragging and
dropping the attachment to another part of the text fails. I see the
following message in my log:
-[NSTextView concludeDragOperation:]: Failed to read from drag pasteboard.
Drag operation failed.
I've implemented the initWithCoder and encodeWithCoder methods. That didn't
help (although encodeWithCoder is being called during the drag).
I also implemented the initWithFileWrapper, setFileWrapper, and fileWrapper
methods. Again this didn't help.
What am I missing?
Jon.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.