I am trying to solve a problem which seems to involve the first responder for an NSWindow.
The NSWindow contains a number of controls and views, including several NSTextField controls. It is necessary to show or hide groups of these. These are all created dynamically, rather than with Interface Builder. When a field containing text (created as an NSTextField) is contains the cursor, it has a blue(?) highlight box drawn around it. (We do not implement this, it just happens). But when the field is hidden, we would like the highlight box to go away. In our oldest test system, 10.6.8, this is what happens - the highlight box is removed when the text field is hidden. But in our newest available test system, 10.10.1, the highlight box is left in place, only moving if we click into one of the newly shown NSTextFields. So, it seems reasonable to check, when hiding a field, whether it is highlighted. This is where I'm stuck. I use [NSWindow currentFirstResponder], but the value returned is never the NSTextView that I am hiding. It seems to be an NSText object, which I didn't make. Perhaps it is the [NSTextField currentEditor]. But this is getting into guesswork. So... 1. Is there a more appropriate way to identify if a particular control has what I would loosely call "the focus"? 2. As a quick fix, is there a way to make sure this highlight box disappears with the control that it is (to my mind) attached to? Thanks in advance. _______________________________________________ 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