On 10 Sep 2014, at 01:56, Kyle Sluder <k...@ksluder.com> wrote:

> On Tue, Sep 9, 2014, at 06:42 PM, Graham Cox wrote:
>> 
>> On 10 Sep 2014, at 7:13 am, Luc Van Bogaert <luc.van.boga...@me.com>
>> wrote:
>> 
>>> This opens the panel without making it key, which is OK, but it still makes 
>>> the panel key when I click any of the responder objects in the panel, such 
>>> as a collectionview...
>> 
>> 'becomesKeyOnlyIfNeeded' does what it says, but how does it define
>> 'needed'. It does that by allowing the panel to become key if any of its
>> views or controls accept first responder. So to prevent that, these also
>> need to refuse FR by overriding -acceptsFirstResponder to return NO.
> 
> There's also the corresponding method, -needsPanelToBecomeKey, which is
> used by things like text fields to ensure they actually work when
> clicked on.
> 

No succes so far with this.

I subclassed NSPanel and overridden:

- (BOOL) becomesKeyOnlyIfNeeded
{
    return YES;
}

- (BOOL) canBecomeKeyWindow
{
    return YES;
}

I also subclassed the collection view in the panel and overridden:

- (BOOL) acceptsFirstResponder
{
    return NO;
}

- (BOOL) needsPanelToBecomeKey
{
    return NO;
}

Clicking the collectionview still makes the panel the key window, which is 
exactly what I'm trying to avoid.

-- 
Luc Van Bogaert

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

Reply via email to