• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can I prevent attributes to be pasted into my text view along with the text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I prevent attributes to be pasted into my text view along with the text?


  • Subject: How can I prevent attributes to be pasted into my text view along with the text?
  • From: Marc Liyanage <email@hidden>
  • Date: Sun, 30 Mar 2003 22:26:40 +0200

Hi,

I have a custom NSTextView subclass which is used to edit code in a monospace font of a fixed size.
I do not want the user to mess with the font settings of that text view.

Unfortunately, if the user uses copy/paste to paste a snippet of text, the attributes are pasted along and this messes up the font settings.
Instead of all monospace text of the exact same size, I now have a mix.

Can I somehow force the NSTextView to strip any attributes from pasted text, leaving only the raw data?
Do I have to override functions of some object along the responder chain, or is there an easier way with less work?

I tried setting -isRichText:NO on the text view, but that doesn' help and I'm not even sure if I really understood its purpose.



Cheers

-Marc



_________________________________________________________________
Marc Liyanage email@hidden
http://www.entropy.ch
ICQ 5077985

Yoda I am. Grammar I can't.
_________________________________________________________________
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: HIView elements in Cocoa window? (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Apple default Help menu not visible in IB's MainMenu
  • Next by Date: Icon hit test
  • Previous by thread: Re: HIView elements in Cocoa window?
  • Next by thread: Re: Unarchiving Problem Solved
  • Index(es):
    • Date
    • Thread