• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Selection in NSCollectionView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selection in NSCollectionView


  • Subject: Re: Selection in NSCollectionView
  • From: Lee Ann Rucker <email@hidden>
  • Date: Tue, 2 Nov 2010 15:57:44 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Selection in NSCollectionView

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 (email@hidden<mailto: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<http://lists.apple.com>

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________

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

References: 
 >Re: Selection in NSCollectionView (From: Andrew Shamel <email@hidden>)

  • Prev by Date: Re: Selection in NSCollectionView
  • Next by Date: Joining App Developer Program
  • Previous by thread: Re: Selection in NSCollectionView
  • Next by thread: Joining App Developer Program
  • Index(es):
    • Date
    • Thread