So at that event or at the beginning of it resign first responder and manually 
set the next responder. 
You may need some logic to decide what is the next responder. 
You may also need to ask the window to recalculate the next responder chain in 
it. 

Sent from my iPhone

> On Sep 29, 2015, at 7:47 PM, Eyal Redler <eyred...@netvision.net.il> wrote:
> 
> I have a custom NSView subclass (let's call it "container"). The view 
> contains many subviews and the subviews can have two states: expanded and 
> collapsed.
> When one of the subviews is expanded, it reveals an editable text field, when 
> the subview is collapsed, the field is removed.
> The container needs to also to be able to handle keystrokes (arrow keys) and 
> for that purpose it access first responder implements keyDown.
> The reason I'm handling arrow keys in the container is that there is a 
> concept of "selection" in that view and I want to allow the user to modify 
> the selection using the arrow keys (similar to what you would do with a table 
> view)
> My problem is as follows:
> If I click one of the container subviews - the container will become first 
> responder and the keyboard is handled correctly.
> If, after that, I expand one of the subviews and start editing the text, the 
> text field will grab keyboard handing (which is OK and expected) but, when I 
> collapse that subview, and the editable text field is removed, keyboard focus 
> doesn't come back to the container and no amount of clicking around the other 
> subview of the container will restore that ability. It is as if having edited 
> the text field "Destroyed" the ability of the container to get keyboard focus.
> 
> Thanks in advance 
> 
> 
> 
> Eyal Redler
> ------------------------------------------------------------------------------------------------
> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
> way."
> --James Randi
> www.eyalredler.com
> 
> 
> _______________________________________________
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.com

_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to