• 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
NSCollectionView, Draggable View & Selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSCollectionView, Draggable View & Selection


  • Subject: NSCollectionView, Draggable View & Selection
  • From: Arthur Carli <email@hidden>
  • Date: Mon, 27 Jul 2009 14:10:19 +0200

Hi all,
I've been playing with the NSCollectionView control for some time now, and
I'm stuck with this problem :
So I've a collection view, with a prototype view. I wanted the prototype
view to be dragable, so I've subclassed the NSView prototype and implemented
mouseDown: and mouseDragged:.
All works fine.
The only problem is that the NSCollectionViewItems can't be selected
anymore, unless I add a [super mouseDown:event] in my mouseDown:
implementation... but in this case, the dragging won't work :-/.

To sum up :

With this one, DRAGGING : OK, SELECTION : NOT OK

> -(void)mouseDown:(NSEvent *)event
> {
>     [event retain];
>     [mouseDownEvent release];
>     mouseDownEvent =event;
>
>     if([event clickCount]>1)
>     {
>         NSNotificationCenter * nc =[NSNotificationCenter defaultCenter];
>         [nc postNotificationName:@"ViewParticipantDoubleClick"
> object:self];
>     }
> }
>

And this one, DRAGGING : NOT OK, SELECTION : OK

> -(void)mouseDown:(NSEvent *)event
> {
>     [event retain];
>     [mouseDownEvent release];
>     mouseDownEvent =event;
>

>
   [super mouseDown:event];


>
    if([event clickCount]>1)
>     {
>         NSNotificationCenter * nc =[NSNotificationCenter defaultCenter];
>         [nc postNotificationName:@"ViewParticipantDoubleClick"
> object:self];
>     }
> }


I believe it has something to do with the first responder, but I can't
figure clearly were the problem is.

Any idea what the problem might be ?

Thanks in advance

Arthur C.
_______________________________________________

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

  • Prev by Date: Re: memory allocation different in simulator and on the iPhone
  • Next by Date: Re: Cocoa Document-Based App v. Windows MDI App
  • Previous by thread: Re: NSWindow reference remains null after window did load (SOLVED)
  • Next by thread: NSTextView - NSAttributedString paragraph style attributes
  • Index(es):
    • Date
    • Thread