• 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
Re: Formatters and TextViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatters and TextViews


  • Subject: Re: Formatters and TextViews
  • From: Rob Rix <email@hidden>
  • Date: Sun, 9 Sep 2001 15:11:45 -0400

If, as I infer, you are really sure you *have* to have a NSTextView and not
a NSTextField, then you would have to do that programmatically.

Pretty sure, yeah. I'm working on a super-duper text editor thing. I'm trying to make it act like CocoaDev.com: when you write WordsJammedTogether (that is, capitalized words with no spaces between them), I want it to colour them blue, underline them, and allow you to click them (the last part seems to me to be the difficult one).

- use the NSText(View) delegate methods to know whenever text contents changed;
- inside them, use the NSFormatter services to check the validity of text;
- add your own category (or subclass or co-operating class or whatever)
which would use the NSFormatter conversion services from/to string, and use
the NSText string/setString: methods to get/put the string to/from the
NSText.

Okay...yeah, I think I can see that working alright.

Thanks very much,

-- Rob

Witticism forthcoming.


  • Prev by Date: Re: IRC-like NSTextView.... ?
  • Next by Date: Re: Mac OS X 10.1 File Name Extension Guidelines (John Geleynse)
  • Previous by thread: Re: Formatters and TextViews
  • Next by thread: Re: Formatters and TextViews
  • Index(es):
    • Date
    • Thread