• 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
Re: Bounds of selected NSTableView cell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bounds of selected NSTableView cell


  • Subject: Re: Bounds of selected NSTableView cell
  • From: Felix Franz <email@hidden>
  • Date: Sun, 08 Apr 2012 18:08:46 +0200

Hi Koen,

you can use NSTableView>>frameOfCellAtColumn:row: to get the frame of the cell at the columnIndex/rowIndex.
The controlView of the cell is the NSTableView-object, and thus you always get the bounds of the table itself.
For the rects of rows/columns you can use rectOfRow:/rectOfColumn:

Cheers,

Felix


On 08.04.2012, at 17:56, Koen van der Drift wrote:

> 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

--
Mit freundlichen Grüßen,

Felix Franz

Lead Software Engineer

ERGOSIGN GmbH
Europa-Allee 12
66113 Saarbrücken
Phone: +49 681 98 84 12 14
Fax: +49 681 98 84 12 10
www.ergosign.de

HRB 11850
Amtsgericht Saarbrücken

Geschäftsführung:
Dr. Marcus Plach
Prof. Dr. Dieter Wallach

Sitz der Gesellschaft:
Saarbrücken








_______________________________________________

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


  • Follow-Ups:
    • Re: Bounds of selected NSTableView cell
      • From: Koen van der Drift <email@hidden>
References: 
 >Bounds of selected NSTableView cell (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Bounds of selected NSTableView cell
  • Next by Date: Re: Bounds of selected NSTableView cell
  • Previous by thread: Bounds of selected NSTableView cell
  • Next by thread: Re: Bounds of selected NSTableView cell
  • Index(es):
    • Date
    • Thread