 |
 |
I need help with NSTableView behavior
|
 |
|
 |
|
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status:
Online
|
|
ok, my objective seems simple: on return, I want my table to end editing but not change the selection, or begin editing another cell. Sounds like there should be a delegate method for that, but I haven't found it. So then I thought I can subclass NSTableView. But when I try that (and to put it in a NSScrollView, because without that it's useless), I get "*** -[NSTableView documentView]: selector not recognized" and a crash with SIGTRAP
so wtf? how do I subclass NSTableView and give it the standard behavior (I can't fiddle with something that doesn't work to start with)? Someone please help me see the obvious
I also tried putting a normal NSTableView in a subclass of NSWindow, but the window did not intercept the keystrokes when a table cell was highlighted. sigh...
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Oct 2001
Status:
Offline
|
|
you have to overload
Code:
-(void) textDidEndEditing: (NSNotification*) not
select the current cell and end editing.
type R
|
|
I be that insane n***a from the psycho ward.
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status:
Online
|
|
thanks for the help
but simply adding that method to my table's delegate/data-source does not work (the method is never called). If you mean that I have to subclass NSTableView and then override the method, then I need help subclassing NSTableView in a way that duplicates the default behavior, scrollbars and all.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
I believe the method Type R meant was
Code:
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status:
Online
|
|
ok, I added that method to my delegat/data-source, and it is called, but doing so doesn't change the behavior. I've experimented with trying to cancel the default behavior (on selectionDidChange, I change it back to where it was before the last data change), but that is inadequate, because for example if the user clicks out of a selected cell, the selection jumps back to where s/he didn't want it. What I have to do is prevent the selection from changing in the first place (on Enter). anyone know how to do that? Is there a way to intercept keystrokes to an NSTableView (or it's scrollView or contentView) without subclassing, or if so, can someone point me to how to subclass successfully? thanks again for the input
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|