Skip navigation.
 
mlRe: Leopard NSTableView Cell and single click editing
FROM : Corbin Dunn
DATE : Thu Nov 29 17:35:28 2007

>
>

>> Mani, in regard to your original problem -- how did you limit an 
>> editing session on Tiger?

>
> If I remember correct, I overwrote the trackMouse:... routine of the 
> cell. If the user clicks on the special area of my NSTextFieldCell 
> subclass, I am doing something else. But the single click editing 
> seems to happen at another level (most probably in the NSTableView 
> mouseDown code, I think).
>
> But I was able to solve my problem. I found a way to disable the 
> single click editing on Leopard, so the app behaves exactly like on 
> Tiger. (I did not find a solution to get the desired behaviour plus 
> single click editing on Leopard. But that's not so critical in my 
> case and I spent no more time into that.)
>

>> Side note: there is a way to disable the single-click editing 
>> behavior

>
> There is: I just always return NO in the tableview delegate method 
> tableView:shouldEditTableColumn:row:.
> I still can start an editing session programmatically 
> (editColumn:...), if I want to. In my case editing is only available 
> through a contextual menu. Double clicking is overwritten with 
> another action that makes more sense in my app (but I think it must 
> be possible to start an editing session here if I would have wanted 
> that, too).



Yes -- that will work, it just removes the ability for the editing to 
automatically happen without a right click.

What you are referring to is one of the primary reasons why single-
click to edit is so beneficial for apps and users. You have some 
particular text in a cell that you want to be editable, yet at the 
same time you also want a doubleAction to do something else. 
Previously, on Tiger, there was no way to differentiate them; a double 
click would *always* begin editing (unless you did some additional 
work). Now, with "hitTestForEvent:", you can have finer grained 
control, and still all double clicking on text to perform the 
doubleAction, while single-clicking on text will begin editing. IMHO, 
this is an ideal solution. Take Xcode for example; the project list 
supports a doubleAction (ie: open that file in a new window). Before 
Leopard, the only way to inline-edit was with a strange (and not 
easily discoverable) alt-click to begin editing the cell. On Leopard, 
it is much easier; you just single-click on the text (ala Finder) to 
begin editing.

--corbin

Related mailsAuthorDate
mlLeopard NSTableView Cell and single click editing Manfred Schwind Nov 26, 16:00
mlRe: Leopard NSTableView Cell and single click editing j o a r Nov 26, 16:47
mlRe: Leopard NSTableView Cell and single click editing Stephane Sudre Nov 26, 18:13
mlRe: Leopard NSTableView Cell and single click editing Corbin Dunn Nov 28, 01:52
mlRe: Leopard NSTableView Cell and single click editing Manfred Schwind Nov 29, 12:37
mlRe: Leopard NSTableView Cell and single click editing Corbin Dunn Nov 29, 17:35
mlRe: Leopard NSTableView Cell and single click editing Wdyp Nov 29, 23:41
mlRe: Leopard NSTableView Cell and single click editing Corbin Dunn Nov 30, 02:07
mlRe: Leopard NSTableView Cell and single click editing Mike Wright Dec 1, 12:47
mlRe: Leopard NSTableView Cell and single click editing Corbin Dunn Dec 3, 21:55
mlRe: Leopard NSTableView Cell and single click editing john chen Mar 20, 22:32
mlRe: Leopard NSTableView Cell and single click editing john chen Mar 21, 17:47