What I've done is have a custom NSView subclass that all my CollectionViewItems 
use, which subclasses hitTest: and mouseDown:

- (NSView *)hitTest: (NSPoint)aPoint // IN
{
   NSView *hitView = [super hitTest:aPoint];
   if (hitView && ![hitView isKindOfClass:[NSTextField class]]) {
      hitView = self;
   }
   return hitView;
}

- (void)mouseDown: (NSEvent *)event // IN
{
   if ([event clickCount] > 1) {
      [delegate doDoubleClick:self];
   } else {
      // Pass along to superview, which will handle delegate selection.
      [[self superview] mouseDown:event];
   }
}


On Nov 2, 2010, at 3:33 PM, Andrew Shamel wrote:

Hi there great and wise Cocoa-Dev!

I am wondering if anyone knows if there has been any movement regarding how 
selection is handled in NSCollectionViews.  I see there was some conversation 
on this subject a couple of years back 
(http://www.cocoabuilder.com/archive/cocoa/217489-selection-in-nscollectionview.html),
 and I'm having similar trouble.

My desire is this: when the user clicks anywhere in a collection subview (i.e., 
not just on the base view, but on any controls within that view), the 
collection view takes not and selects it as would be intuitive.

I am simply using the default Interface Builder tools here, building my view 
there, though I'm not, of course, afraid of subclassing.

Thank you so much!

Pax,

Andy_______________________________________________

Cocoa-dev mailing list 
(Cocoa-dev@lists.apple.com<mailto: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<http://lists.apple.com>

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com

This email sent to lruc...@vmware.com

_______________________________________________

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