Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prevent Editing of Table View Cell




On Mar 21, 2005, at 4:49 PM, Charles Ross wrote:

Is there a way to prevent the editing of a table view cell and capture the action of the user double-clicking it instead? I want the action of double-clicking the cell to have the same effect as clicking on the row and clicking a button, but I can't see a way to attach a double clicked handler to a row, only a table. As it stands, double-clicking the cell enters it for editing. I want to prevent the editing and allow the double-clicking to send a double click message. Any suggestions?

You need to set the particular COLUMN as not editable if you want to have the double click handler called. See the documentation for -[NSTableView setDoubleAction:] for more. You can do this either in IB or in code or finer granularity can be obtained by using the table view delegate method tableView: shouldEditTableColumn:row:


If the cell is not editable and you double click, the the double click handler will be called. While, as you note this is attached to the table not to a row but you can determine where the double click took place via the sender parameter.

James P. Spencer
Rochester, MN

email@hidden

"Badges??  We don't need no stinkin badges!"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Prevent Editing of Table View Cell (From: Charles Ross <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.