Re: NSTableView vertical focus change...
Re: NSTableView vertical focus change...
- Subject: Re: NSTableView vertical focus change...
- From: Colin Doncaster <email@hidden>
- Date: Thu, 18 Jan 2007 11:27:02 -0500
I've fixed the problem, it actually came down to the
ArrayController's selectionIndex. It makes sense that the table
would want to try an maintain focus on the selected entry, when you
drag ( and change the relationship ) on the selected entry the index
becomes void and the ArrayController sets it to 0, the table wants to
focus on that and pops back to the top.
I avoid this now by setting the selectionIndex to the entry that is
one less than the first selected one, this happens in the acceptDrop
in the Tables delegate.
Just and FYI.
cheers.
On 17-Jan-07, at 9:10 AM, Colin Doncaster wrote:
I have an NSTableView that has columns that are bound to an
ArrayController that controls a Core Data object. I have a button
at the bottom of the table that performs the "remove" action on the
data and I also have drag and drop set up so I can drag data out of
said table into other tables.
There are times when there can be hundreds of entries in the table,
which means I have to - say - scroll down to the bottom of the
table. When I select an item and use the remove key ( calling the
remove action ) the table stays "focused" one the area of the table
I'm looking at. When I drag an item out of the table it removes
the item but the table is then reset so I'm looking at the very top
again - effectively loosing my place.
I think what is happening is the remove is called on the
ArrayController thus letting that handle removing the data ( so
only the ArrayController is "dirty ) - where when I perform the
drag and drop I'm changing a relationship in the Core Data model
which makes the ArrayControllers source "dirty" thus causing more
work and a reset of the ArrayController's index table. Is there
any way around this?
Is this, in fact, what's happening or is there a "don't update on
change" toggle somewhere?
_______________________________________________
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