Nava Carmon
Nava Carmon

Reputation: 4533

Focus ring on NSPopupButton doesn't appear on pressing tab

I have a couple of NSPopupButtons on my view and they are defined as a newKeyView after one of the text fields. The problem is that somehow they are not getting the focus ring when pressing the tab button comes to them, like they are ignored. What should be done in order for them to get a focus ring?

Thanks,

Nava

Upvotes: 1

Views: 759

Answers (2)

Renato Mauro
Renato Mauro

Reputation: 11

You can create a subclass of NSPopupButton and override method canBecomeKeyView, returning YES. My code using python:

class ComboBox(AppKit.NSPopUpButton):
    def canBecomeKeyView(self):
        return True

Upvotes: 0

rdelmar
rdelmar

Reputation: 104092

The default behavior in OSX is to only have certain controls be navigable by the tab key. You can change this in the keyboard preferences pane in System Preferences. In the Keyboard Shortcuts tab, select the "All controls" radio button.

Upvotes: 2

Related Questions