Re: Getting mouse events in view placed in NSTableRowView
Re: Getting mouse events in view placed in NSTableRowView
- Subject: Re: Getting mouse events in view placed in NSTableRowView
- From: Kyle Sluder <email@hidden>
- Date: Fri, 23 Nov 2012 14:32:40 -0800
On Nov 23, 2012, at 2:08 PM, email@hidden wrote:
> Hi,
>
> I'm having a problem with a subclass of NSTableRowView I'm trying to implement. I have custom NSTableCellView that contains a button. When I press the button, I want that row to expand in height. I would like to then place a custom NSView into that new space (think of it as a detail view of the cell that was clicked).
>
> I created an NSTableRowView subclass, but currently have no custom code (except to trap mouse events and immediately call "super" with them). When the button is clicked, I add my custom view as a subview of my custom NSTableRowView, and it appears. The problem is that this custom view does not see any mouse events. As a simple test, I placed a slider control into the view, but I can't move it.
Are you sure you don't want to make it a subview of the cell view instead?
>
> Stepping through the debugger, I see that my NSTableRowView subclass is indeed being used, that it contains no other subviews than all of the NSTableRowView instances for each column plus the one I manually added. I put an NSLog statement in the NSTableRowView's mouseDown method, but no mouse downs are being recorded in the open space created by updating the height of the table. I have called "noteHeightOfRowsWithIndexesChanged" when making these changes.
You seem to be confusing NSTableCellView with NSTableRowView.
>
> Where are the mouse clicks going!?? This is driving me batty.
You could try breaking on -[NSTableView hitTest:] and see what return value it puts in %rax on return. Or just compute a point within your control's frame and call -hitTest: from the debugger.
--Kyle Sluder
_______________________________________________
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