Re: Navigating a TableView: A Solution
Re: Navigating a TableView: A Solution
- Subject: Re: Navigating a TableView: A Solution
- From: Matt Neuburg <email@hidden>
- Date: Sun, 12 Mar 2006 09:17:35 -0800
- Thread-topic: Navigating a TableView: A Solution
On Sun, 12 Mar 2006 08:52:45 -0700, Peter Bates <email@hidden> said:
>I subclassed NSWindow so I could catch the keyDown event, which it
>seems is not passed on from the field editor when one edits a table
>cell. The first responder is the cell rather than the table (which
>is the delegate of the cell). So I needed a way to capture the event
>and pass it on to the table.
But surely you've answered your own question. You know there is a field
editor and that the table view is the field editor's delegate. And you are
already subclassing NSTableView. Ergo...?
Example: You want the table view to do something special when the user
presses up-arrow while editing a table cell. So you could implement the
field editor's delegate method in your NSTableView subclass:
- (BOOL)textView:(NSTextView *)aTextView
doCommandBySelector:(SEL)aSelector {
if (aSelector == @selector(moveUp:)) {
// ...
This is not the only possible architecture (another would be for the
window's delegate to return your own NSTextView subclass as field editor for
the table view) but it has a certain appealing economy.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden