bug-gnustep
[Top][All Lists]
Advanced

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

Re: -setTarget: and -setAction: of NSImageView


From: Kazunobu Kuriyama
Subject: Re: -setTarget: and -setAction: of NSImageView
Date: Tue, 23 Dec 2003 23:20:27 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1

Hi,

Because I still don't understand the reason why GNUstep's
NSImageView need to raise an exception when it receives either
-setTarget: or -setAction:, let me continue the discussion
a little bit further.

According to the specifications at http://developer.apple.com,
we know that
(1) Almost all concrete classes inherited from NSControl are
implemented using NSCell.
(2) -setTarget: and -setAction: methods of NSCell are to
raise an exception.
(3) However, NSActionCell, a subclass of NSCell, have to
receive these methods.

In addition, there's another stuff to be noted. Seeing an
example of usage of NSImageView in page 239 of the book,
S. Anguish, E.M. Buck, and D.A. Yacktman, "Cocoa Programming",
SAMS, 2002, we know that an NSImageView can receive both
-setTarget: and -setAction: methods. (The source code of
the example can be downloaded from http://www.cocoaprogramming.net. )

The current GNUstep implementation of NSImageView uses
NSCell.  In this sense, the current behaior, that is,
to raise an exception, is (superficially) consistent to
the specs. However, it doesn't conform to the behavior
of the Cocoa's genuine NSImageView.

Consequently, IMHO, NSImageView should be reimplemented
using NSActionCell, instead of NSCell, so that it can
receive the two method mentioned above.

Having said so, because the specs says neither that NSImageView
should use NSCell nor that it should use NSActionCell, one cannot
obviously say which implementation is right.  The currrent
implementation might be superior to the Cocoa's in terms of
some unknown broader point of view.

But it is clearly better for GNUstep to be as close as possible
to Cocoa's AppKit unless there's some reason for making GNUstep
distinguishable from Cocoa.

I hope this email makes clearer what I want to say in previous
emails in this thread.

Thanks.





reply via email to

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