MacRuby: NSTableView Select all rows with CMD+A
If you have a NSTableView in your MacRuby application with the ability to select multiple rows, you probably want it to respond to the typical keyboard shortcuts.
This process is actually easier than you might expect. It consists of 1) Sub-classing NSTableView, 2) Overriding the keyDown method, and 3)Listening for the correct keyboard combination. There may be a better way of doing this, but I couldn’t seem to find anything.
Now simply change your table’s class from NSTableView to SelectAllTable. Add more
ifelseconditions to look for other keyboard events.
Shablagoo!
