bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] -setTarget: and -setAction: enabled in NSImageView


From: Kazunobu Kuriyama
Subject: Re: [PATCH] -setTarget: and -setAction: enabled in NSImageView
Date: Wed, 24 Dec 2003 12:10:10 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1



Alexander Malmberg wrote:

Kazunobu Kuriyama wrote:

Hi,

Because no one gives me any solution to my problem on NSImageView,
I offer my own here. They simply makes NSImageView enable
target/action without raising an exception.


Not really; they also make it send the action when an image is dropped
on it, but that's the point of the behavior change, so that's ok. :)

Thank you for improving my coarse explanation. Your effort helps
our good understanding on the issue.
(snip)

[patch]

address@hidden NSImageCell : NSCell
address@hidden NSImageCell : NSActionCell


This 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.

Thank you for taking that trouble.



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.

I failed to pay attention to this point.  Good suggestion.



[...]

+      [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.

Now I begin to understand the difference between primitive -performSelector:
and -sendAction:to:.  Thank you.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]