Enable PopUp if NSTextField > 0
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