discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tabbing into not editable cells


From: Quentin Mathé
Subject: Re: Tabbing into not editable cells
Date: Fri, 8 Sep 2006 12:50:43 +0200

Le 20 août 06 à 13:49, Quentin Mathé a écrit :

Le 7 juil. 06 à 02:20, Fred Kiefer a écrit :

Andreas Höschler schrieb:
I just discovered a serious bug in NSTableView. We have a column in the tablevie that is set to setEditable:NO. This successfully prevents the user from doubleclicking into the cell. But he can doubleclick into any other (ediatble) cell of the row and then use the TAB keys to navigate
to the (not editable) column and edit the value nevertheless.

Looks like you found a rather strange behaviour in NSTableView. In the function _isCellEditable() we do not check for the actual settings for
the cell, but only asks the delegate, if there is one. Could somebody
please verify what the behaviour on MacOSX is like?

If verifying the behavior on Mac OS X is still needed, I can do it.

Fred, sorry for the delay, finally I found some time today to write a test app.

It's possible to set whether a table column is editable or not in IB, then I think Mac OS X behavior looks logical.

Here is the result of my investigation…
When a table column is not editable, its data cell still return YES for -isEditable, I call [column dataCellForRow:] to check this, however it's impossible to edit a cell in a such column by double- clicking or tabbing from another column as reported by Andreas. If I implement the following delegate method - tableView:shouldEditTableColumn:row:, returning NO if the table column is editable has no effect, but returning YES if the table column isn't editable makes the cell(s) editable. This matches Cocoa documentation that states: "The delegate can implement this method to disallow editing of specific cells".

So I think we should check in the function _isCellEditable both the delegate method and the column to decide whether a cell is editable.

I didn't check what happens if we change the cell editability directly with something like [[column dataCellForRow: row] setEditable: YES/NO]. I think the setting will be discarded since table view uses a cell prototype.

Quentin.

--
Quentin Mathé
qmathe@club-internet.fr





reply via email to

[Prev in Thread] Current Thread [Next in Thread]