Cocoa / Obj-c: how to change tab key behavior inside NSTableView?

There are 5 columns in my table view.

  • Col-1 - Not Editable
  • Col-2 - NSTextFieldCell (editable)
  • Col-3 - NSComboBoxCell (editable)
  • Col-4 - NSComboBoxCell (editable)
  • Col-5 - NSButtonCell

By default, when you press the tab key, the control moves from one editable cell to the next editable cell. The only thing I want to change here is when the control is in the last edited cell, that is, Col-4 and the user with his choice and presses the Tab key, the control should move down to the first edited cell (i.e. Col-2) next line. I tried crossing the tab key press using control:textView:doCommandBySelector: But I can’t find out from which editable cell it was called.

Can someone point me in the right direction how to do this?

Maybe I'm using the wrong control? Perhaps something is even more appropriate.

Thanks Abhijeet

+4
source share
1 answer

You may be able to capitalize on one of the answers posted on this question that I asked many years ago regarding the use of arrow keys in NSTableViews. I am sure it will not be too difficult to take one of these answers and configure it to handle tabs. In fact, I think I did just that in the code I was working on, but forgot to update my answer (to my own question). I do not have access to this code, unfortunately, & hellip;

+1
source

Source: https://habr.com/ru/post/1387686/


All Articles