Setting the font of an NSTextView

Posted by Koning Baard on Stack Overflow See other posts from Stack Overflow or by Koning Baard
Published on 2010-06-14T14:30:36Z Indexed on 2010/06/14 14:32 UTC
Read the original article Hit count: 702

Filed under:
|
|

I am subclassing NSTextView to set it's default font:

PTNfoEditField.h

@interface PTNfoEditField : NSTextView {

}

@end

PTNfoEditField.m

@implementation PTNfoEditField

-(id)init {
    if(self = [super init]) {
        [[self textStorage] setFont:[NSFont fontWithName:@"Courier" size:10]];
    }

    return self;
}

@end

However, this does not work and I don't know how to do it in a different way. Can anyone help me? Thanks.

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about nstextview