NSTextView font problem using arraycontroller
NSTextView font problem using arraycontroller
- Subject: NSTextView font problem using arraycontroller
- From: Grant Christensen <email@hidden>
- Date: Wed, 20 Jan 2010 23:27:34 +1000
Hi all,
I have an array controller that is feeding a NSTableView on a window. Also on the window are a few text fields showing the contents of the selected row (shows more than table). One of the fields is an NSTextView.
I am having a problem with fonts in the text view (google searches show this is no stranger to font idiosyncrasies).
When I click on a row in the table the text view shows the data under that row for that field, which is a multi line string. The font used seems to be the default font, not what I have set for the view. I can then set the font for the view using setFont and/or setTypingAttributes:
[atisView setFont: font];
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];
[attributes setObject: font forKey: NSFontAttributeName];
[atisView setTypingAttributes:attributes];
However each time a new row is selected it reverts to the default font again. I have a slider that allows the user to change the font size used for the window, and triggering that resizes the font to the correct size again, but that is not a suitable solution.
Any thoughts on how to make the font I set stay as the font between row changes?
---
Grant Christensen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden