Re: NSCollectionView deselection
i was struggling with this, when i happened to stumble across a remark from someone on the cocoadev-forums that hit the nail right on the head: " … Also, you didn't call super's -setSelected: within your override … " http://cocoadev.com/forums/discussion/comment/2190#Comment_2190 So, in your implementation of setSelected: in your NSCollectionViewItem-subclass, also call [super setSelected:..] Something to easily overlook. g arri On Tue, Mar 2, 2010 at 8:25 PM, Markus Spoettl wrote: > On Mar 2, 2010, at 10:52 AM, Thomas Davie wrote: >> The NSCollectionView certainly *thought* it was being deselected – if the >> user clicks A, then A again, only one setSelected:YES gets sent, if the user >> clicks A, then B, then A again, setSelected:YES gets sent to A twice and B >> once. >> >> I've worked around this now by writing an NSCollectionView subclass with my >> own selection and drag/drop code. > > You shouldn't need to work around this because this just works when > everything is set up correctly. The fact that it doesn't work for you > indicates that there's something wrong with your setup. You don't give any > details on how everything is set up in your case. > > Regards > Markus > -- > __ > Markus Spoettl > > > ___ > > 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/arritjeparretjenof%40gmail.com > > This email sent to arritjeparretje...@gmail.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
Re: NSCollectionView deselection
On 2 Mar 2010, at 04:03, Markus Spoettl wrote: > On Mar 1, 2010, at 2:42 PM, Thomas Davie wrote: >> However, when the user clicks on item B after clicking on item A, >> setSelected:NO is *not* sent to the NSCollectienViewItem subclass for A. >> This displeases me greatly :(. > > > Works fine for me. Are you sure it's not called/set? Put a breakpoint into > the setter into the setter of your NSCollectienViewItem subclass to find out. Hmm, that's exactly how I'm finding out that it's not being called :/ I wonder what else could be going on here. Tom Davie___ 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
Re: NSCollectionView deselection
On 2 Mar 2010, at 14:39, Markus Spoettl wrote: > On Mar 2, 2010, at 3:36 AM, Thomas Davie wrote: >>> On Mar 1, 2010, at 2:42 PM, Thomas Davie wrote: However, when the user clicks on item B after clicking on item A, setSelected:NO is *not* sent to the NSCollectienViewItem subclass for A. This displeases me greatly :(. >>> >>> >>> Works fine for me. Are you sure it's not called/set? Put a breakpoint into >>> the setter into the setter of your NSCollectienViewItem subclass to find >>> out. >> >> Hmm, that's exactly how I'm finding out that it's not being called :/ > > > Then it actually may not be deselected. Are you sure it is being deselected? > What controls your selection? What is your binding setup? Do you have > multi-selection enabled? Maybe something is wrong with the selectionIndexes > of the NSArrayController which I presume provides the content of the > collection view and the selection. You're not saying what your setup is like. The NSCollectionView certainly *thought* it was being deselected – if the user clicks A, then A again, only one setSelected:YES gets sent, if the user clicks A, then B, then A again, setSelected:YES gets sent to A twice and B once. I've worked around this now by writing an NSCollectionView subclass with my own selection and drag/drop code. Tom Davie___ 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
Re: NSCollectionView deselection
On Mar 2, 2010, at 10:52 AM, Thomas Davie wrote: > The NSCollectionView certainly *thought* it was being deselected – if the > user clicks A, then A again, only one setSelected:YES gets sent, if the user > clicks A, then B, then A again, setSelected:YES gets sent to A twice and B > once. > > I've worked around this now by writing an NSCollectionView subclass with my > own selection and drag/drop code. You shouldn't need to work around this because this just works when everything is set up correctly. The fact that it doesn't work for you indicates that there's something wrong with your setup. You don't give any details on how everything is set up in your case. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ 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
Re: NSCollectionView deselection
On Mar 2, 2010, at 3:36 AM, Thomas Davie wrote: >> On Mar 1, 2010, at 2:42 PM, Thomas Davie wrote: >>> However, when the user clicks on item B after clicking on item A, >>> setSelected:NO is *not* sent to the NSCollectienViewItem subclass for A. >>> This displeases me greatly :(. >> >> >> Works fine for me. Are you sure it's not called/set? Put a breakpoint into >> the setter into the setter of your NSCollectienViewItem subclass to find out. > > Hmm, that's exactly how I'm finding out that it's not being called :/ Then it actually may not be deselected. Are you sure it is being deselected? What controls your selection? What is your binding setup? Do you have multi-selection enabled? Maybe something is wrong with the selectionIndexes of the NSArrayController which I presume provides the content of the collection view and the selection. You're not saying what your setup is like. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ 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
Re: NSCollectionView deselection
On Mar 1, 2010, at 2:42 PM, Thomas Davie wrote: > However, when the user clicks on item B after clicking on item A, > setSelected:NO is *not* sent to the NSCollectienViewItem subclass for A. > This displeases me greatly :(. Works fine for me. Are you sure it's not called/set? Put a breakpoint into the setter into the setter of your NSCollectienViewItem subclass to find out. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ 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
NSCollectionView deselection
Hi, I have, after much struggling with the documentation, managed to create an NSCollectionView that displays all the items I want it to. However, selection isn't quite working right. When the user clicks on item A, setSelected:YES is sent to the NSCollectionViewItem subclass for A. This pleases me :) When the user clicks on item B, setSelected:YES is sent to the NSCollectionViewItem subclass for B. This pleases me too :). However, when the user clicks on item B after clicking on item A, setSelected:NO is *not* sent to the NSCollectienViewItem subclass for A. This displeases me greatly :(. Is there some way I can get my NSCollectionView to tell me when the user deselects items? Thanks Tom Davie ___ 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