Skip navigation.
 
mlhow to insert a NSAttributedString into a NSTextview ?
FROM : Jérémie Banier
DATE : Sat Dec 25 21:22:24 2004

Hello,

I'm pretty new to cocoa and I would like to know how you can insert an
Attributed string into a NSTextView ...
I was expecting the following to do some things but I does not do much
...

NSMutableString* s = [ NSMutableString stringWithFormat: @"0x%08lx:",
fh?foff:(unsigned long)p ];
foff += sizeof(ppc_word);
tempString = [tempString initWithString: s ];
[ tempString addAttribute: NSForegroundColorAttributeName
                   value: [NSColor blueColor]
                 range: NSMakeRange(0, [ s length ])];        
[ myRTFTxt replaceCharactersInRange: NSMakeRange(0, [ [ myRTFTxt string
] length ])
                       withString: tempString ];

I would appreciate any comments, pointer, samples ...

Many thanks,
Jéré.

Related mailsAuthorDate
mlhow to insert a NSAttributedString into a NSTextview ? Jérémie Banier Dec 25, 21:22
mlRe: how to insert a NSAttributedString into a NSTextview ? James Spencer Dec 26, 16:35
mlRe: how to insert a NSAttributedString into a NSTextview ? Jonathan Jackel Dec 26, 19:32