 |
 |
NSFormatter
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
For some reason I can't figure this out. I've subclassed it and added the 3 main/required methods but still can't figure out how this works.
Could someone either explain how it works or (better yet) just do a simple formatter subclass that turns everything blue or something?
Well, back to trial & error for now at least.
TIA!
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
Well, I got it turning blue but only when all editing is done. I can't figure out how to make it use my attributed string for display after -isPartialStringValid.. is called.
So, if you can help, it would be much appreciated.
TIA, again! 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
Moving this back to the top in hopes that someone knows how to do this.
I just need to get everything typed (or pasted, etc.) to show in blue (using an NSFormatter subclass). Okay, so it doesn't have to be blue - any NSAttributedString would do.
I've read the NSFormatter doc about 12 times, from top to bottom. I've tried everything I can think of.
Anyone?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status:
Offline
|
|
I don't think you can use NSFormatter to use NSAttributedStrings while typing -- just basic NSStrings. The only NSAttributedString method is called when editing is done, as you saw.
Is there any reason you can't just call setTextColor: on the NSTextField or NSTextFieldCell? That should keep the text color while editing.
If you need to conditionally set the color while typing, you'll have to use the NSControl delegate methods.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
Hmm, that's kind of what I'd figured. Too bad.
Using setTextColor: wouldn't work. I need to be able to use graphics and multiple colors/styles in my formatting.
So, off to go read the NSControl docs (again  ).
Thanks for the pointer! 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |