Re: [newbie] /r invoking button instead of going to textfield?
Re: [newbie] /r invoking button instead of going to textfield?
- Subject: Re: [newbie] /r invoking button instead of going to textfield?
- From: Ondra Cada <email@hidden>
- Date: Mon, 16 Sep 2002 00:55:29 +0200
On Sunday, September 15, 2002, at 11:32 , Ando Sonenblick wrote:
However, in the method that gets called by the button, I am using the
currentEditor method to determine which of the three edit fields is the
current one:
- (IBAction) convert: (id) sender
{
if ([binaryTextFieldOutlet currentEditor] != nil)
[self performBinarySourceConversion];
if ([decimalTextFieldOutlet currentEditor] != nil)
[self performDecimalSourceConversion];
if ([hexTextFieldOutlet currentEditor] != nil)
[self performHexSourceConversion];
}
This works fine when the button is triggered via the mouse; but not when
via
the return key.
Instead, none of the text fields is the currentEditor. I'll look into
what
I can do about this, but perhaps you know of a better way to determine the
current text field of a window?
Yup. In this case, link the fields directly to the convert: action, and
then just check the sender -- it would be either the buton, or the
appropriate textfield.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.