You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
I am attempting to use KDXCollectionView as a grid of subviews which contain sub controls such as buttons. I was initially stumped as to why my buttons were not getting click events, but I tracked it down to the KDXCollectionView's override implementation of hitTest.
I believe what you really want to do is call the super's hitView, and only eat the clicks if they are not intended for a subview. The following code fixes it for me, although since I'm pulling this in as a Cocoapod it gets a little messy for me to change.
I am attempting to use KDXCollectionView as a grid of subviews which contain sub controls such as buttons. I was initially stumped as to why my buttons were not getting click events, but I tracked it down to the KDXCollectionView's override implementation of hitTest.
I believe what you really want to do is call the super's hitView, and only eat the clicks if they are not intended for a subview. The following code fixes it for me, although since I'm pulling this in as a Cocoapod it gets a little messy for me to change.
(NSView *)hitTest:(NSPoint)aPoint
{
NSView *hitView = [super hitTest:aPoint];
if (!hitView && NSMouseInRect(aPoint, [self visibleRect], [self isFlipped])) {
return self;
}
return hitView;
}
The text was updated successfully, but these errors were encountered: