[Resending this as a later email I sent was delivered but this wasn't; sorry if you receive a duplicate copy.]

In Leopard, checkboxes in my NSOutlineViews get keyboard focus when I press Tab. I don't want this to happen.

The AppKit release notes <http://developer.apple.com/releasenotes/Cocoa/AppKit.html > state:

Tables now support inter-cell navigation as follows:

- Tabbing forward to a table focuses the entire table.
- Hitting Space will attempt to 'performClick:' on a NSButtonCell in the selected row, if there is only one instance in that row.

So far, so good.

- Tabbing again focuses the first "focusable" (1) cell, if there is one.

I don't want the NSButtonCell to ever get focus.

(1) A focusable cell is generally defined as [cell isEnabled] && [cell isSelectable] in a table column that is editable. However, NSTextFieldCells also check if the row is selectable, and tableView:shouldEditTableColumn:row: returns YES (if implemented by the delegate). NSImageCells cannot be focused. NSButtonCells only check if the [cell isEnabled].

Disabling the NSButtonCell is not feasible; I want it to be operable.

I've tried a number of things that don't help, including:

1. [checkBoxColumn setEditable: NO];

2. [checkBoxCell setEditable: NO];

3. [checkBoxCell setRefusesFirstResponder: YES];

4. - (BOOL)outlineView:(NSOutlineView *)ov shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)column item:(id)item {
   return NO;
}

5. - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item {
   return NO;
}

6. - (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectTableColumn:(NSTableColumn *)tableColumn {
   return NO;
}
(a long shot, certainly)

7. overriding keyDown: in the outline view to intercept Tab, which works fine, except...

- Back tabbing into a table will select the last focusable cell.

and I can't figure out how to stop that from happening.

Help?

--
Nicholas Riley <[EMAIL PROTECTED]> | <http://www.uiuc.edu/ph/www/njriley>

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to