Re: NSView -nextKeyView and -previousKeyView only working once
Re: NSView -nextKeyView and -previousKeyView only working once
- Subject: Re: NSView -nextKeyView and -previousKeyView only working once
- From: Mike Abdullah <email@hidden>
- Date: Fri, 16 Feb 2007 18:02:20 +0000
Well your window's content view will only ever have the same
nextKeyView unless you explicitly change it yourself. Instead, you
could try something like this:
NSResponder *firstResponder = [myWindow firstResponder];
if ([firstResponder isKindOfClass: [NSView class]])
{
NSView *nextView = [(NSView *)firstResponder nextKeyView];
if (nextView) {
[myWindow makeFirstResponder: nextView];
}
}
Mike.
On 16 Feb 2007, at 17:04, Michael Watson wrote:
I have a window whose content view contains a set of buttons.
Calling this makes the first button the first responder:
[myWindow makeFirstResponder:[[myWindow contentView] nextKeyView]];
However, subsequent repeats result in the same button being made
first responder. I compared addresses to see what -nextKeyView was
returning, and sure enough, it would only ever return the same
object. -previousKeyView exhibited the same behaviour.
Clearly, I'm doing something wrong in my attempts to traverse the
buttons with -nextKeyView. What should I be doing instead?
--
m-s
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40mikeabdullah.net
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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