I want to layout an NSTextAttachment (an image) to the right margin inside a text paragraph such that text would flow around the image. I have managed to coordinate the text container to correctly adjust the proposed rows, and to make my layout manager to draw the attached image to the correct place in
the text container.

My problem is that the text row, where the attachment is, becomes as high as
the attachment, and I don't seem to find an easy way around it.

You might try setting your attachment's cell to a custom subclass that rigs the height of the attachment. Override "cellFrameForTextContainer:etc:" and others to return some small/ bogus height.

My question is: what is the right way to draw an attachment, and to let text flow around it?

There's not really any "right" way to do this. As far as the Cocoa text layout system is concerned, attachments are always inline / character graphics.

~Martin

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to