• 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: Cocoa-dev Digest, Vol 12, Issue 137
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa-dev Digest, Vol 12, Issue 137


  • Subject: Re: Cocoa-dev Digest, Vol 12, Issue 137
  • From: Motti Shneor <email@hidden>
  • Date: Mon, 09 Mar 2015 17:33:25 +0200

>
> Date: 9 במרץ 2015 בשעה 11:58:11 GMT+2
> From: Dragan Milić <email@hidden>
> Subject: Re: All buttons lost focus ring on Yosemite
> To: Cocoa-dev <email@hidden>
>
>
> On pet 06.03.2015., at 18.37, Kyle Sluder wrote:
>
>> On Fri, Mar 6, 2015, at 10:49 AM, Dragan Milić wrote:
>>
>>> Thanks for the suggestion. A bad category was something I also thought could be the reason for this behaviour, but it looks like it isn’t. There are no NSButton, NSButtonCell, nor NSControl categories. There is a single NSView category, but it doesn’t do anything related to drawing, it just defines and implements some convenient methods for finding subviews and superviews of a certain class.
>>
>> Please post the code for this category. Maybe it's colliding with an internal implementation detail of the focus ring mechanism.
>
> Sure, no problem. Since it’s a bit long, I attached it as a separate ObjC source file. A few notes:
>
> * It’s rather old code (not made by me) that I haven’t looked into for years until this problem appeared.
> * I rearranged it a bit for easier reading, so there may be some copy/paste/typo errors, but you should get the overall idea what it does.
> * All drawing related code is contained within unique methods, no overriding.
> * I was “lying”, there is a small NSButton category (defined within the same file), but it just checks if a button is of a checkbox type.
>
> Thanks for looking into this, as I really hit a dead end with it.
>
> <NSView-NTExtensions.m>
>
> — Dragan
>

Hi Dragan,

but your NSView-NTExtensions has EVERYTHING  to do with drawing the focus ring. Please remember that NSButtons and NSControls are all subclasses of NSView.

Your category NSView+NTExtensions defines “drawFocusRing” and overrides LOTS of native NSView methods — these changes in the category apply to ALL views, including your NSButtons. Maybe that’s the source of your problem.

You could verify very simply by setting a breakpoint in your “drawFocusRing” method, and see if one of your buttons actually executes this method instead of the original.

It is not recommended to mess with the NSView or NSWindow behavior, because we don’t know what Apple is doing in their implementation.

Motti Shneor.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: All buttons lost focus ring on Yosemite
      • From: Dragan Milić <email@hidden>
  • Prev by Date: Re: disabling Apple Crash Reporter
  • Next by Date: Re: disabling Apple Crash Reporter
  • Previous by thread: Re: Document based architecture
  • Next by thread: Re: All buttons lost focus ring on Yosemite
  • Index(es):
    • Date
    • Thread