Image in NSTextView
Image in NSTextView
- Subject: Image in NSTextView
- From: email@hidden
- Date: Mon, 30 Apr 2001 16:36:45 -0700
How would you insert an image held in memory as an NSImage object into an
NSTextView?
I know that I can write the image to a standard image file and then
instantiate an NSTextAttachment with a NSFileWrapper created from this
file, which I could then add to the NSTextView, but for my purposes, I'd
really rather NOT have to use a temporary file - the NSImage is created on
the fly and has a small enough footprint that having to write it to disk
before putting it into an NSTextView is an unnecessary inconvenience and
creates additional "cleanup" work that I'd like to avoid.
I know I'm probably overlooking an obvious mechanism for doing this...
Thanks,
Jeff