Re: How to implement to rename the file by single click its name column
Re: How to implement to rename the file by single click its name column
- Subject: Re: How to implement to rename the file by single click its name column
- From: Jens Alfke <email@hidden>
- Date: Mon, 14 Sep 2009 20:57:24 -0700
On Sep 14, 2009, at 8:12 PM, James wrote:
I can implement to play the file by double click its name column
only. But I do not know
how to implement to rename the file by single click its name column.
Unfortunately this isn't one of the things NSTableView makes easy for
you. If I recall correctly, the steps to doing this are:
1. Subclass NSTableView and override mouseDown: to start a timer for
some interval like 0.5sec if the user clicked on an editable name
column. (Don't forget to call super too.)
2. When the timer goes off, check that the user hasn't clicked
elsewhere in the view, and the view is still first responder.
3. If so, make the clicked column in the selected row editable.
—Jens_______________________________________________
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