Setting NSTextView's Font
Setting NSTextView's Font
- Subject: Setting NSTextView's Font
- From: Seth Willits <email@hidden>
- Date: Tue, 30 Mar 2004 23:04:21 -0800
I would like my NSTextView to only use one font, Monaco 10-pt. In the
awakeFromNib method I have:
[[self textStorage] addAttribute:NSFontAttributeName value:[NSFont
fontWithName:@"Monaco" size:10.0] range:NSMakeRange(0, [[[self
textStorage] mutableString] length])];
But this does not work. My first thought was simply to set the font in
the nib itself, but it only works if the field also has text in it,
otherwise it defaults to Helvetica 12.
Is there something I'm missing?
Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software -
http://www.freaksw.com
REALbasic Guru at ResExcellence -
http://www.resexcellence.com/realbasic
Webmaster for REALbasic Game Central -
http://www.freaksw.com/rbgames
"Black holes are where God divided by zero."
-- Steven Wright
------------------------------------------------------------------------
---
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.