text in tableview animating inappropriately
text in tableview animating inappropriately
- Subject: text in tableview animating inappropriately
- From: Ken Victor <email@hidden>
- Date: Tue, 15 May 2007 16:37:37 -0700
i've got an NSTableView bound via an NSArrayController. the cells in
this table are editable. i have a custom field editor for the table.
my custom field editor (in addition to other functionality) overrides
insertText: such that if the user is currently editing the second
column, and the result of the insert would be a single character
string of a space character, then i delete the text in that column
and tab to the next column (see code below). the problem is the
drawing of the 3rd column: rather than selecting the text in the 3rd
column in one "atomic operation" the selected text in the 3rd column
"slides in" from the right edge of the column. this is very
noticeable if i make the 3rd column very wide and set the 3rd column
to be left justified. the starting point of the slide appears to be
the width of the 2nd column. i do not have any animations in place.
if i simply tab from the second column to the third column, all works
as expected.
my (pseudo) code in the custom field editor:
- (void) insertText: (id) aString
{
if ((currentColumn == 2) && (result would be single space character))
{
[self setSelectedRange: NSMakeRange( 0, [[self string] length])];
[self deleteBackward: self];
[self insertTab: self];
}
else
[super insertText: aString];
}
can anyone suggest what might be causing this behavior? or more to
the point, what can i do to not get this animation effect?
thanx,
ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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