NSTextView retain text

When I set Window backgroundColor = .clear, disable NSTextView draw background, then I change NSTextView.string as you can see in the picture, preview text retain in the background.

POC code is here SingleView

How can I clear the background text (Foo1245 in the image background) when change NSTextView.string ?

I see that you set ScrollView>ClipView to not draw background.

If you change this, the phantom FOO12345 disappear when drawing new background.

I was intrigued by a point:

  • how do you set the full view to be transparent ?

I would try the following:

NSTextView retain text
 
 
Q