• 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
Re: [newbie] /r invoking button instead of going to textfield?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Re: [newbie] /r invoking button instead of going to textfield? (From: Ando Sonenblick <email@hidden>)

  • Prev by Date: NSNotification and undos
  • Next by Date: Creating DMG that are compressed+encrypted+EULA
  • Previous by thread: Re: [newbie] /r invoking button instead of going to textfield?
  • Next by thread: Re: Data to String: what encoding?
  • Index(es):
    • Date
    • Thread