On Oct 28, 2008, at 2:11 PM, chaitanya pandit wrote:

Hi list,
I have a NSTableView, and i display a menu when the user right clicks a row, this menu allows the user to delete that item.
My problem is, how do i get the row which was right clicked?

Consider this: currently the row#1 is selected and the user right clicks row#3 the row#3's cell will have a blue border, now in the right click's menu's action method if i call [tableview selectedRow]; it'll return "1" where as what i want is "3"

How do i identify the row that was right clicked?

clickedRow
Returns the index of the row the user clicked to trigger an action message.

- (NSInteger)clickedRow

Return Value
The index of the row the user clicked to trigger an action message. Returns –1 if the user clicked in an area of the table view not occupied by table rows.

Discussion
The return value of this method is meaningful only in the target’s implementation of the action or double-action method.

Availability
        • Available in Mac OS X v10.0 and later.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to