Newbie:Attributed Text Strings and NSTextView
Newbie:Attributed Text Strings and NSTextView
- Subject: Newbie:Attributed Text Strings and NSTextView
- From: Clayton Leitch <email@hidden>
- Date: Fri, 24 Sep 2004 09:31:45 -0400
I have a program with two NSTextViews. The first NSTextView holds a simple NSString. This one works great. The second NSTextView holds an attributed string (or at least it should) that changes the display font. Two problems have happened. I initialize the NSAttributedString with the NSString used to fill the first NSTextView. Then I use the NSFont class to create a font object I attempt to use a font with the name Arial. Obviously I have constructed this call wrong since it fails to compile. Next when I attempt to use the addAttribute I am told that stringTest will not respond to the addAttribute method. Last I have failed to find the method to set the contents of the testList NSTextView to the testString. Source code shown below.
Thanks
newFont = [fontWithName:@"Arial" size:24];
stringTest = [[NSMutableAttributedString alloc] initWithString:stringNumber];
[stringTest addAttribute:NSFontAttributeName
value:[newFont userFontSize:24]];
[testList setString:stringTest]; _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden