• 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
Enable PopUp if NSTextField > 0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enable PopUp if NSTextField > 0


  • Subject: Enable PopUp if NSTextField > 0
  • From: Lorenzo <email@hidden>
  • Date: Tue, 26 Jul 2005 11:55:57 +0200

Hi,
in my interface window I have a NSTextField containing a decimal
NSNumberFormatter which can accepts values from -10.0 to +10.0
Then I have a NSPopupButton which I want to enable only if the text field
contains values > 0. So, I subclassed NSTextField and overrided the method

- (void)textDidChange:(NSNotification*)aNotification
{
    [super textDidChange:aNotification];
    [aPopUp setEnabled:([self floatValue] > 0)];
}

so I though, I can get the intValue of the text field at any key pressed,
and if greater than zero I enable the popUp. But since there is a formatter
in the text field this method doesn't work. I am able to write one only char
in that field. No more. And

    NSText *fieldEditor = [[aNotification userInfo]
            objectForKey:@"NSFieldEditor"];

returns nil; Also I have been trying to create a bind between the popUp and
the textField but it seems to be not so easy. I didn't succeed.
Any suggestion?



Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Enable PopUp if NSTextField > 0
      • From: Charilaos Skiadas <email@hidden>
  • Prev by Date: Re: email processing on Mac OS X.
  • Next by Date: Re: email processing on Mac OS X.
  • Previous by thread: Re: Really struggling with Saving in NSDocument
  • Next by thread: Re: Enable PopUp if NSTextField > 0
  • Index(es):
    • Date
    • Thread