An alternative to the other ideas presented previously:
Read up on NSAttributedString. Use NSTextAttachment to attach your image to an NSAttributedString, and then use -setAttributedStringValue to set the string in your NSTextField.
This has worked nicely for me with the cells in NSTableView -- I don't see why it wouldn't work in an NSTextField.
This approach will let you embed your image as an in-line image that is locked to a character position in the text.
And you can build test strings in TextEdit, use initWithRTFD:documentAttributes: to import them into NSAttributedString.
_______________________________________________
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]
