Re: Outline View CancelEditing
Re: Outline View CancelEditing
- Subject: Re: Outline View CancelEditing
- From: Sandro Noël <email@hidden>
- Date: Fri, 18 Dec 2009 11:32:27 -0500
The esc Key is trapped like this inside the View controller that is loaded inside the window.
-(BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
{
if (command == @selector(cancelOperation:)) {
NSLog(@"escape key has been pressed");
}
return NO;
}
I do not have access to the window instance.
How do i get to the window?
On 2009-12-18, at 9:48 AM, Graham Cox wrote:
>
> On 19/12/2009, at 1:35 AM, Sandro Noël wrote:
>
>> But how do I actually cancel the editing operation?
>
> Just make the outline view itself first responder. This will validate and resign the text field if it's OK.
>
> [[outlineView window] makeFirstResponder:outlineView];
>
> --Graham
>
>
_______________________________________________
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