Re: how do I get the "key" sub view of a window?
Re: how do I get the "key" sub view of a window?
- Subject: Re: how do I get the "key" sub view of a window?
- From: Nicholas Riley <email@hidden>
- Date: Tue, 10 Dec 2002 06:24:08 -0600
- Mail-followup-to: Donald Hall <email@hidden>, email@hidden
On Tue, Dec 10, 2002 at 12:15:44AM -0700, Donald Hall wrote:
>
However, [mywindow firstResponder] returns an NSTextView, presumably the
>
content view of the window.
>
>
NSTextView does not accept the message firstResponder.
>
>
I'm sure I must be missing something easy, but I couldn't find anything
>
in the documentation that would do what I want.
Actually not obvious at all, although IMO this should be very easy to do.
<
http://cocoa.mamasam.com/COCOADEV/2002/03/2/28501.php>
So you'd do something like this:
if ([field1 currentEditor] != nil) {
[field1 selectText: self];
} else if ([field2 currentEditor != nil) {
[field2 selectText: self];
}
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
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.