Re: setFirstResponder to NSTextField fails 1st time, works next
Re: setFirstResponder to NSTextField fails 1st time, works next
- Subject: Re: setFirstResponder to NSTextField fails 1st time, works next
- From: Moses Hall <email@hidden>
- Date: Wed, 02 Jul 2008 18:03:00 -0400
Matt Neuburg wrote:
What's the purpose of this test? Is it necessary? Is it working? Try putting
an NSLog inside the test to see whether it is passing/failing when you think
it should be.
Thanks for the the response, Matt.
The "if ([[item identifier] isEqual:@"Search"])" is to avoid stealing
key window status for any other pane beside the search pane. This is
weird behavior I know, but since this is a palette-class input method,
getting key status in most circumstances would break it. My palette
window would end up sending Unicode input events to itself, not the host
application. So I only want to be key when the user is entering text
into the palette, and I force it to inactivate when editing ends or
another tab is selected. Character Palette's behaves similarly with its
search field.
Per your suggestion, I checked with an NSLog and the test is indeed
working as designed.
Cheers,
-- Moses
>> Here is my tab switch delegate method:
>> -(void)tabView:(NSTabView*)tv
>> didSelectTabViewItem:(NSTabViewItem*)item
>> {
>> NSLog(@"first responder WAS %@", [_window firstResponder]);
>> if ([[item identifier] isEqual:@"Search"])
{
[_window makeKeyWindow];
[_window makeFirstResponder:_searchText];
}
NSLog(@"first responder: %@", [_window firstResponder]);
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden