Thanks for the suggestions. I have found a solution. I make my file's owner the 
text field's delegate, and then implement the following:

- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView 
doCommandBySelector:(SEL)command {
        if (command == @selector(insertNewline:)) {
                [[control window] makeFirstResponder:nil];
                [[control window] performSelector:@selector(ok:) 
withObject:self afterDelay:0];
                return YES;
        }
        return NO;
}



Regards

Gideon

On 12/05/2011, at 12:47 PM, Kyle Sluder wrote:

> On Wed, May 11, 2011 at 6:26 PM, Gideon King <[email protected]> wrote:
>> Hi, I have a text field which is used in a save panel accessory when 
>> exporting files from my program. It is bound to the user defaults, and has 
>> continuous updating of values turned on so that if the user presses Return 
>> to complete the save operation, I still have the current value even though 
>> the text field end editing is bypassed.
> 
> The better way to do this might be to call -commitEditing on the user
> defaults controller in your panel delegate's -windowWillClose:
> implementation.
> 
> --Kyle Sluder

_______________________________________________

Cocoa-dev mailing list ([email protected])

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