On May 12, 2011, at 10:05, Brad Stone wrote:

> For my NSTableView (NSIndexSet *)tableView:(NSTableView *)tableView 
> selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes 
> fires on mouseDown and (void)tableViewSelectionDidChange:(NSNotification 
> *)aNotification fires on mouseUp.
> 
> For my NSOutlineView (NSIndexSet *)outlineView:(NSOutlineView *)outlineView 
> selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes 
> and (void)outlineViewSelectionDidChange:(NSNotification *)notification fire 
> only on mouseUp.  

This can't be true.

For a start, thinking of the delegate methods as "firing" on mouse events seems 
like a way to lead yourself astray. There are *various* ways to change a 
selection, only some of which start at a mouse down event, and the delegate 
methods are invoked at *various* points in the procedure depending on 
circumstances, no matter how it starts. (Well, ...DidChange presumably gets 
invoked only at the end, but what constitutes the end may vary.)

Specifically, if NSOutlineView's 'selectionIndexesForProposedSelection:...' 
method wasn't ever called until a mouse up event (after an initial mouse down, 
I mean), it wouldn't be possible to prevent rows from getting selected while 
the mouse is being dragged, and it *is* possible to do so.

There may be specific scenarios where the view decides not to invoke the 
delegate until mouse up, but that fact just demonstrates the pointlessness of 
trying to parse the mouse event behavior.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to