• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Deselect keyboard focus of an NSMatrix cell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Deselect keyboard focus of an NSMatrix cell
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: print object by %@
  • Next by Date: Re: print object by %@
  • Previous by thread: Re: Small caps in NSTextView
  • Next by thread: Re: Deselect keyboard focus of an NSMatrix cell
  • Index(es):
    • Date
    • Thread