Re: NSTableView right clicked row
Re: NSTableView right clicked row
- Subject: Re: NSTableView right clicked row
- From: Corbin Dunn <email@hidden>
- Date: Tue, 28 Oct 2008 13:48:38 -0700
Note that the documentation is slightly wrong, as it is also valid
when the menu pops up.
Please see the "DragNDropOutlineView" demo app which shows how to
properly create a dynamic contextual menu.
..corbin
On Oct 28, 2008, at 1:34 PM, chaitanya pandit wrote:
Thanks Randall, funny that my subject says "...clicked row" and i
missed clickedRow :-)
On 29-Oct-08, at 1:51 AM, Randall Meadows wrote:
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 (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