The whole responder chain is traversed like the following, via the documentation for NSApplication.sendAction(_:to:from:)
: First, NSResponder.respondsToSelector(_:)
is called to check if the current candidate is a match; if this returns false, NSResponder.supplementalTarget(forAction:sender:)
is sent to get to another receiver to delegate the call to.
Continue reading …
The Cocoa/AppKit documentation is very sparse when it comes to tabbing. You can make use of the native window tabbing introduced in macOS Sierra with a few simple method calls, though. Conceptually, this is what you will need to do: However, there are some caveats when implementing these methods naively. The plus button may stop working (no new tabs are added when you click it) and all default shortcuts are broken, their main menu items greyed out.
Continue reading …
I utilize NSResponder
actions in TableFlip to move the selection around. Naturally, neither a standard NSTableView
nor a custom NSResponder
implement default behavior for (most of) the methods I need to support arrow key movement, tab movement, and the usual shortcuts, like Cmd-Left to jump to the first cell in the current row. Or Alt + arrow keys to insert a row or column next to the selection. So I implemented this in a custom NSResponder
subclass.
Continue reading …