Issues with NSTextView Attachments
Issues with NSTextView Attachments
- Subject: Issues with NSTextView Attachments
- From: Gordon Apple <email@hidden>
- Date: Sat, 10 Aug 2013 12:31:15 -0500
- Thread-topic: Issues with NSTextView Attachments
Using NSTextView¹s native ability to embed image attachments, we have
successfully implemented resizing of the image by using a resizable frame
with a drag handle, and using setSize on the NSImage. Works great. Only
one problem, re-archiving the NSAttributableString loses the image size
change. Any way to fix this? Internally, in a CoreData auxiliary file
folder, we archive NSAttributableString. Would we be better off storing it
as RTFD?
I also see allusions to subclasses of NSTextAttachment, but I see no way to
tell NSTextView, or its associates, to use such a subclass.
NSTextAttachmentCell is a protocol. But who adopts this protocol? For an
image, is this really a NSImageCell adopting this protocol? Or is it the
NSTextAttachment? Confusion here. Documentation on attachments is sparse.
We would also like to have the ability to set the baseline when an image is
inserted, and change it when the image is resized. Certain NSPDFImageReps
contain baseline info in private dictionaries, which we would like to use,
when available. In view of the above, should we abandon NSTextView¹s
paste/drag-in capabilities for images and override all the relevant methods
to do our own attachment inserts using a custom NSAttachment class?
Related question about NSImage. I¹ve never understood setSize in NSImage.
Does this just affect the cached image, or does it have any impact on the
underlying imageRep, such as resizing and remapping a bitmap?
One more: I¹ve never found a straightforward way to make a textView
re-layout all or a portion of the text. The best way I¹ve found is to call
textContainerChangedGeometry. Works, but seems rather obtuse.
Inquiring minds need to know.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden