• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSView -nextKeyView and -previousKeyView only working once
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView -nextKeyView and -previousKeyView only working once


  • Subject: Re: NSView -nextKeyView and -previousKeyView only working once
  • From: Michael Watson <email@hidden>
  • Date: Fri, 16 Feb 2007 18:25:12 -0500

Ah, that makes sense. Something like that did indeed work exactly as I needed.


-- m-s

On 16 Feb, 2007, at 13:02, Mike Abdullah wrote:

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


References: 
 >NSView -nextKeyView and -previousKeyView only working once (From: Michael Watson <email@hidden>)
 >Re: NSView -nextKeyView and -previousKeyView only working once (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: PDFMarkupAnnotations not showing when drawing PDFPage
  • Next by Date: Re: Core Data, bindings and synchronizing.
  • Previous by thread: Re: NSView -nextKeyView and -previousKeyView only working once
  • Next by thread: Restoring Temporary Menu Title Changes
  • Index(es):
    • Date
    • Thread