Bounds of selected NSTableView cell
Bounds of selected NSTableView cell
- Subject: Bounds of selected NSTableView cell
- From: Koen van der Drift <email@hidden>
- Date: Sun, 08 Apr 2012 11:56:54 -0400
I am trying to find out what the bounds are of the cell of an NSTableView that was clicked in. I'd like to use that rect to show a NSPopover when the user double clicks on a cell. I have this in my NSTableView controller class:
-(IBAction)doubleClickAction:(id)sender
{
NSInteger row = [sender selectedRow];
NSCell *cell = [myTableColumn dataCellForRow: row];
NSRect cellRect = [[cell controlView] bounds];
[self.myPopover showRelativeToRect: cellRect ofView:sender preferredEdge:NSMaxXEdge];
}
The popover shows up nicely, but always points to the middle of the table, instead of to the cell that was clicked in.
How can I get the bounds of the cell that was clicked in?
Thanks,
- Koen.
_______________________________________________
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