Hi folks.
I am using a source list view (view based NSOutlineView) and trying to display
some items in bold text (using the default system font, not a custom font) and
it's not working.
In interface builder I have the default non-group NSTableCellView that was
created when I dragged in the source list. I use a subclass to handle the font
selection logic but otherwise it's vanilla. My calls to -setStringValue: on the
NSTextField work fine.
However calling -setFont: does not change the font that's used to display the
item labels in the outline. After calling -setFont: both the NSTextField and
it's corresponding cell both respond with the correct font info. But they go
ahead and draw in the regular font anyway.
I've tried turning on RichText for the view, no difference.
Finally I tried changing the font directly in InterfaceBuilder. I set it to
System font 18pt and in Interface Builder it looks right. But, when I run the
app, the outline items are all drawn in the regular font!
At this point the relevant code boils down to:
[[self textField] setFont:[NSFont boldSystemFontOfSize:6.0]];
[[self textField] setStringValue:[pond name]];
[[self imageView] setObjectValue:[pond sidebarIconImage]];
Logging the font after the call to setFont shows the correct font. The call to
-setStringValue: (and to set the icon) both work.
At this point I am baffled and figure I am missing something obvious about view
based outline view drawing but I have no clue what. Nor can I glean anything
from Google or StackOverflow. If anyone could help me I'd be most grateful.
Kind regards,
Matt
--
http://mattmower.com/
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]