2

I am experimenting with a word processor I am making and is curious if it is possible to have floating images or text boxes (not inline with text) in an NSTextView. If that isn't possible what would I have to use to go in that direction?

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
Gwyn
  • 21
  • 2

1 Answers1

1

For images (or arbitrary views, really), you can use an NSTextAttachment and NSTextAttachmentCell. There are a couple of other questions on Stack Overflow about them like NSTextView insert image in between text or Mixing graphics in NSTextView?.

Depending on what you mean by "floating", you might have to develop a custom NSTextContainer.

Community
  • 1
  • 1