Re: Waiting on NSTableView to finish changing selection
Re: Waiting on NSTableView to finish changing selection
- Subject: Re: Waiting on NSTableView to finish changing selection
- From: Kyle Sluder <email@hidden>
- Date: Wed, 8 Jul 2009 10:15:01 -0700
On Wed, Jul 8, 2009 at 8:33 AM, Allan Donald<email@hidden> wrote:
> I've got an NSTableView that triggers some relatively expensive stuff
> when its selection changes. If the user is holding down one of the
> arrow keys to move through the list, I'd like to wait until they've
> finished before starting the operation. (Somewhat akin to what
> Mail.app does -- it won't update the message pane preview if the
> user's scrolling through a long list of messages with the arrow keys)
Subclass NSTableView and override -keyDown: to set a flag (let's call
it isKeyedScrolling) when appropriate. Override -keyUp:, and if
isKeyedScrolling is true then fire a custom delegate method which
performs your expensive update. Then clear isKeyedScrolling.
--Kyle Sluder
_______________________________________________
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