Re: how do I detect a click in a tableView cell?
Re: how do I detect a click in a tableView cell?
- Subject: Re: how do I detect a click in a tableView cell?
- From: Denis Stanton <email@hidden>
- Date: Mon, 22 Mar 2004 14:20:44 +1200
Hi Allan
On 22/03/2004, at 11:23 AM, Allan Odgaard wrote:
>
On 21. Mar 2004, at 23:17, Denis Stanton wrote:
>
>
> I tried putting my custom mouseDown method into my custom ChartCell
>
> class, expecting it to get called when I clicked in one of these
>
> cells.
>
>
The table view only create one cell (pr. column) and re-use that cell
>
(to save memory).
>
>
So you need to intercept the click in the table view -- and it might
>
be that setting yourself as target for the action message is enough.
>
When you receive the action message then you can send clickedRow
>
and/or clickedColumn to the table view to get info about which
>
row/column the user clicked.
OK, that's helped a lot. Thank you
I can now get the column and row number where the click happened. I
need to take this further and get the actual co-ordinate of the click
within the cell. I can get the rect of the cell through
frameOfCellAtColumn:row: but I need to get the click point so I can
calculate the horizontal offset of the mouse click within the cell. I
can't see anything in NSTableView's methods to tell me the click point.
I'm looking at the classes above NSTableView, but I can't find
anything to tell me the point location of the click.
Denis
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.