Re: Re: How to check if NSTextField is selected?
Re: Re: How to check if NSTextField is selected?
- Subject: Re: Re: How to check if NSTextField is selected?
- From: "Jordan Evans" <email@hidden>
- Date: Thu, 28 Sep 2006 13:58:53 -0700
On 9/28/06, Shawn Erickson <email@hidden> wrote:
Do you mean it always produces the GMTOffset log message regardless of
field being edited...?
Yes. But, it knows what text field is selected, because it uses the
same pointer (field) which always produces the correct value from the
field that is selected.
So, if it uses the same pointer to get the correct value, why is it
when I compare that pointer to the IBOutlet pointer, it is not equal?
I have control dragged from file's owner to each text field and
connected the IBOutlets.
- (IBAction)findTextField:(id)sender
{
// Gets the selected text field.
NSTextField *field = [[thePanel firstResponder] delegate];
// Always produces the value I put in the field, so IB outlets
are perfectly set.
NSLog(@"field: %i", [field intValue]);
// These are all IB outlets.
if ( field == GMTOffset )
{
NSLog(@"GMTOffset");
}
if ( field == seconds )
{
NSLog(@"seconds");
}
if ( field == minutes )
{
NSLog(@"minutes");
}
// ... more if's
}
_______________________________________________
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