|
From: | Fred Kiefer |
Subject: | Re: [PATCH] -setTarget: and -setAction: enabled in NSImageView |
Date: | Tue, 23 Dec 2003 23:14:07 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 |
Alexander Malmberg wrote:
Kazunobu Kuriyama wrote:-@interface NSImageCell : NSCell +@interface NSImageCell : NSActionCellThis is a very dubious change. The design is sane, but it's a pretty big change, and it's against the docs. I'm going to think about it for a while and let others comment on it. As it is, it also breaks decoding of old NSImageCell:s, which is definitely not ok. If we decide to make this change, -initWithCoder: will have to be updated to handle it. [...]+ [target performSelector: action];This is wrong. You need to handle nil targets, nil actions, the sender argument, etc. To send an action, use [self sendAction: action to: target]. It will handle all that for you.
I want to second Alexanders position here. The documentation from Apple is rather thin on what change should happen. On the other hand it is rather clear on what should not be changed. NSImageCell should remain a subclass of NSCell and not of NSActionCell. We need to investigate further and the best way to do this, would be to write a program on a MacOSX machine and watch it closely. Without this test I would suggest, that we only make changes to NSImageView adding target and action ivars (with setters and getters and encoding) and adding a sendAction call to the performDragOperation: method.
Cheers Fred
[Prev in Thread] | Current Thread | [Next in Thread] |