开发者

Setting default fonts in NSTextView

How can I set the default font of an NSTextView comp开发者_如何学JAVAonent? I need to have an area in my app where users can make changes to a plain text file, and I'd like for the font to be a monospaced font.


Found it. This answer was close, but wouldn't do it - had to access the textStorage object of the NSTextView first:

[[myNSTextView textStorage] setFont:[NSFont fontWithName:@"Menlo" size:11]];


NSFont* font = <whatever>;
[textView setFont: font];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜