NSTableView - differences in click or arrow selection
NSTableView - differences in click or arrow selection
- Subject: NSTableView - differences in click or arrow selection
- From: Martin Hewitson <email@hidden>
- Date: Fri, 26 Jul 2013 08:22:08 +0100
Dear list,
This is a strange one. I have a table view which lists a set of themes. When a theme is selected a textview in another part of the app has its font and colors updated. This all works nicely except for one strange 'feature'. When selecting a theme with the arrow keys (moving up or down) the textview often scrolls to what seems like an arbitrary location. Clicking to select a theme doesn't cause this to happen.
I implement -tableViewSelectionDidChange: in the tableview's delegate and from there post the notification that the selected theme has changed. By various debug statements I've checked that the notification is received the same in both cases.
In the notification handler (in the NSTextView subclass) I call
-setFont
-setTextColor
-setDefaultParagraphStyle
-setTypingAttributes
-setBackgroundColor
-setInsertionPointColor
-setSelectedTextAttributes
-addAttribute:value:range (on textstorage)
Anyone seen this before, or have any idea what can cause an NSTextView to scroll?
Best wishes,
Martin
_______________________________________________
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