Deselect keyboard focus of an NSMatrix cell
Deselect keyboard focus of an NSMatrix cell
- Subject: Deselect keyboard focus of an NSMatrix cell
- From: Jochen Moeller <email@hidden>
- Date: Thu, 22 Jul 2010 20:05:00 +0200
Greetings,
I want to be able to deselect the keyboard focus of a control after hitting Return, whereas Tab moves to the nextKeyView.
When using editable NSTextField objects I can achieve this in the action method with:
[ window makeFirstResponder:[ window contentView ]];
But when using editable NSTextFieldCell objects in an NSMatrix I found no way to do that.
The -makeFirstResponder: method seems not to respond.
I tried this:
1. Same as above.
2. Additional a custom content view which returned YES for
-acceptsFirstResponder and -canBecomeKeyView.
3. Additional modifying the NSMatrix object: "matrix" is the outlet.
[ matrix setAllowsEmptySelection:YES ];
NSLog(@"selectedCell: %p", [matrix selectedCell]); // a valid pointer
[ matrix deselectAllCells ];
NSLog(@"selectedCell: %p", [matrix selectedCell]); // 0x0, but the focus ring remains, why ?
[ matrix display ]; // the focus ring remains
[ window makeFirstResponder:[ window contentView ]]; // did not work.
// Also [ window makeFirstResponder:anotherTextField ]; did not work.
The key focus still remains in the textfield cell of the matrix.
Any ideas?
Thanks,
Jochen Moeller
_______________________________________________
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