Pergunta

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

Foi útil?

Solução

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.

Outras dicas

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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top