Re: How to: NSPopover Refuse First Responder?

2013-03-20 Thread Andy Lee
I always think of more to say *after* I hit Send...

I haven't tried spelunking in iTunes, but I wouldn't be surprised if it doesn't 
use NSPopover. You might want to try an alternative like Matt Gemmell's 
MAAttachedWindow: . I don't know if it has the 
same issues or not, but worth a look I think.

--Andy

On Mar 21, 2013, at 12:44 AM, Andy Lee  wrote:

> 
> On Mar 20, 2013, at 11:44 PM, Graham Cox  wrote:
> 
>> 
>> On 21/03/2013, at 12:53 AM, Brad Stone  wrote:
>> 
>>> How can I have a popover appear but have the NSSearchField never relinquish 
>>> it's firstResponder status or have the NSPopover refuse firstResponder?
>> 
>> 
>> I think you'll need to ensure that none of the views in the popover accept 
>> first responder, which is a pain to do (and if they need to become first 
>> responder under some circumstances, might be impossible in the current 
>> implementation).
> 
> Worth a try but I have a feeling even this wouldn't be enough, because the 
> popover's window could still become key window even if no view within accepts 
> first responder. I suspect this is why it didn't help to have the NSPopover 
> object refuse first responder.
> 
> It would be nice if there were a way to get the popover's window to refuse 
> first responder. I fiddled briefly with Apple's NSPopover sample app and 
> haven't found a way yet to do this. Unfortunately, the window is an instance 
> of a private class (_NSPopoverWindow), which means you don't get a chance to 
> subclass it and override canBecomeKeyWindow.
> 
> The opacity of NSPopover is very reminiscent of NSDrawer.
> 
> --Andy
> 
> 
>> 
>> File a bug asking for something like -becomesKeyOnlyIfNeeded on NSPopover. 
>> The API is currently too limited.
>> 
>> --Graham
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> 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:
>> https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com
>> 
>> This email sent to ag...@mac.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to: NSPopover Refuse First Responder?

2013-03-20 Thread Andy Lee

On Mar 20, 2013, at 11:44 PM, Graham Cox  wrote:

> 
> On 21/03/2013, at 12:53 AM, Brad Stone  wrote:
> 
>> How can I have a popover appear but have the NSSearchField never relinquish 
>> it's firstResponder status or have the NSPopover refuse firstResponder?
> 
> 
> I think you'll need to ensure that none of the views in the popover accept 
> first responder, which is a pain to do (and if they need to become first 
> responder under some circumstances, might be impossible in the current 
> implementation).

Worth a try but I have a feeling even this wouldn't be enough, because the 
popover's window could still become key window even if no view within accepts 
first responder. I suspect this is why it didn't help to have the NSPopover 
object refuse first responder.

It would be nice if there were a way to get the popover's window to refuse 
first responder. I fiddled briefly with Apple's NSPopover sample app and 
haven't found a way yet to do this. Unfortunately, the window is an instance of 
a private class (_NSPopoverWindow), which means you don't get a chance to 
subclass it and override canBecomeKeyWindow.

The opacity of NSPopover is very reminiscent of NSDrawer.

--Andy


> 
> File a bug asking for something like -becomesKeyOnlyIfNeeded on NSPopover. 
> The API is currently too limited.
> 
> --Graham
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com
> 
> This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to: NSPopover Refuse First Responder?

2013-03-20 Thread Graham Cox

On 21/03/2013, at 12:53 AM, Brad Stone  wrote:

> How can I have a popover appear but have the NSSearchField never relinquish 
> it's firstResponder status or have the NSPopover refuse firstResponder?


I think you'll need to ensure that none of the views in the popover accept 
first responder, which is a pain to do (and if they need to become first 
responder under some circumstances, might be impossible in the current 
implementation).

File a bug asking for something like -becomesKeyOnlyIfNeeded on NSPopover. The 
API is currently too limited.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to: NSPopover Refuse First Responder?

2013-03-20 Thread Brad Stone
Hmm. I can think of reasons why this might not work, but it's worth a shot: 
Have you tried subclassing NSPopover and returning NO from 
-acceptsFirstResponder?

--
Seth Willits

Yes, I tried that and tested that it was returning NO.  It didn't work.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to: NSPopover Refuse First Responder?

2013-03-20 Thread Seth Willits
On Mar 20, 2013, at 6:53 AM, Brad Stone wrote:

> I'm trying to replicate the NSPopover functionality that the new iTunes has 
> and I'm 99% there.  The las problem I'm facing is when the NSPopover appears 
> it steals the firstResponder status from the NSSearchField so the user's 
> typing gets interrupted when the popover appears.  I tried giving the 
> firstResponser status back after the popover appear but all that does is mess 
> up the user's typing.  
> 
> How can I have a popover appear but have the NSSearchField never relinquish 
> it's firstResponder status or have the NSPopover refuse firstResponder?

Hmm. I can think of reasons why this might not work, but it's worth a shot: 
Have you tried subclassing NSPopover and returning NO from 
-acceptsFirstResponder?


--
Seth Willits




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to: NSPopover Refuse First Responder?

2013-03-20 Thread Brad Stone
I'm trying to replicate the NSPopover functionality that the new iTunes has and 
I'm 99% there.  The las problem I'm facing is when the NSPopover appears it 
steals the firstResponder status from the NSSearchField so the user's typing 
gets interrupted when the popover appears.  I tried giving the firstResponser 
status back after the popover appear but all that does is mess up the user's 
typing.  

How can I have a popover appear but have the NSSearchField never relinquish 
it's firstResponder status or have the NSPopover refuse firstResponder?

Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com