Re: Formatters and TextViews
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.