Re: cocoa-dev digest, Vol 2 #999 - 13 msgs
Re: cocoa-dev digest, Vol 2 #999 - 13 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #999 - 13 msgs
- From: Raphaël Delcroix <email@hidden>
- Date: Fri, 26 Jul 2002 13:09:29 +0200
Thanks a lot for your responses !
(Brian Webster :)
The short answer is that no such delegate method exists for NSTableView.
Delegate methods are provided for the tasks that the designers
of the class think will be the most commonly used. If enough
people implement a particular feature and request it as being
rolled into the framework, then a new delegate method can be
added. An example of this is the drag and drop methods for
NSTableView, which did not exist before 10.0. If you want the
feature, give Apple feedback, and if enough people want it,
they'll add it (eventually).
well ! (or not ! ;)
Do I really need to subclass NSTableView to do so ? (for such a basic
feature ?)
Yes. This is an interesting progression I see a lot of people
go through from learning Cocoa. If they've done programming in
another environment and are used to subclassing things to add
functionality, they're like "whaddya mean I don't subclass!?".
Then, after they get used to delegates and the like, when
something comes up that requires a subclass, even if it's only
one method, then they're like "whaddya mean I have to
subclass?!". Just an observation I've made. Subclassing's
really not the end of the world, although you still generally
try to avoid it if possible.
:-)
That's done ! and it works well.
Actually,subclassing is far more easy to do than I thought !
One last question : why don't I need to instantiate MyTableView in IB ?
Because it appears in the window (an NSTableView / custom class
MyTableView) ?
In fact, instantiating or not in IB isn't a very clear topic for me yet.
(Matt Neuburg :)
I can't find anything in the NSTableView documentation about this,
Then you didn't look far enough up the class hierarchy. Always remember
to
do that.
All right.
By the way, that's what I did...
It sounds like you want to say e.g.
- (void)keyDown:(NSEvent*)theEvent {
if ([[theEvent characters] isEqualToString: @"\177"]) { // or whatever
...
I found it, but it didn't work; now that I have subclassed NSTableView,
it's all right !
But can I be sure that @"\177" will work on all Macintosh ?
And how do you know this code (except from raw experiment) ?
Are there mnemonics for such codes ?
Moreover, what's NSEvent's 'DeleteFunctionKey' constant ?
I can see no way to manage this constant. I tried the
NSEvent.modifierFlags, but it doesn't work.
R.D.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.