Re: Setting NSTextView's Font
Re: Setting NSTextView's Font
- Subject: Re: Setting NSTextView's Font
- From: Seth Willits <email@hidden>
- Date: Tue, 30 Mar 2004 23:09:21 -0800
On Mar 30, 2004, at 11:04 PM, Seth Willits wrote:
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.
Ok. Ignore that. I'm a moron and haven't yet figured out that I really
need to look at every super of the class (not just a few) before I
think one way is right. Anyway, -setFont. Gee, how convenient.
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.
On the other hand, I still would like to know why this doesn't work.
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
"Only two things are infinite, the universe and human stupidity, and I'm
not sure about the former."
-- Albert Einstein
------------------------------------------------------------------------
---
_______________________________________________
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.