[Top][All Lists]

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

Re: [PATCH (revised)] -setTarget: and -setAction of NSImageView

From: Kazunobu Kuriyama
Subject: Re: [PATCH (revised)] -setTarget: and -setAction of NSImageView
Date: Mon, 29 Dec 2003 03:47:04 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1


Gregory John Casamento wrote:


We should remain the same as MOSX, and leave the class heirarchy alone. NSImageCell is, according to Apple's latest docs, a subclass of NSCell. Why
they did it this way, I'm not sure since NSActionCell would make more sense.

I realize that this assertion might get some ires up, but here goes: For any
and all classes which are part of the GNUstep API which have the NS* prefix and
are therefore intended to be compliant with the OpenStep standard OR provide an
implementation of a Mac OS X class we should at all times maintain
compatibility  with the spec (where the spec is either the OpenStep
Specification or the MOSX Objective-C Developer Documentation for Cocoa).

In addition to the comment above, if someone could give another
one on how an implementation using NSActionCell is technically
inconvenient, I think it would be definitely decisive.

The difference of the responsibilities between NSCell and
NSActionCell is so obvious that Apple's engineers should
know it. Nonetheless, they decided to make NSImageCell a
subclass of NSCell (assuming the present document is still
correct.). Because the decision appears utterly illogical
to me, I think it is possible that the present document is
incorrect.  If I knew the techical reason of the decision,
I could easily withdraw my first view on the issue, i.e.
use of NSActionCell.

Before applying any patch, we should also verify the behavior of MOSX against

Two questions should be answered before we proceed:
1) Does NSImageCell need to have an implementation for the target/action
behaviour? (i.e. is the currently situation acceptable?)

As pointed out by Alexander Malmberg, this is clear from
the documentation found at
http://developer.apple.com/documentation/Cocoa/Conceptual/ImageView/. For your convenience, I quote part of the article here:

Using an Image View to Specify an Image
You can use an image view as an image well, which lets a user specify
an image by dragging an image to it. Just use setEditable: with an
argument of YES.  When the user drags an image to the image view,
the image view replaces its old image and sends its action to its
<end of quote>

However, according to Fred Kiefer's comment, this is not included
in the OpenStep specs.

2) Do we know what the behaviour is on MOSX?

Unfortunately, I have no access to MOSX.  If there's someone having
access to MOSX, I would appreciate it very much if she/he could try
a sample program to see what happens on the MOSX with NSImageView
having target/action.

The sample program is in CocoaProgramming-20021010/Chapter 9/Image Viewer 2
in a freely downloadable compressed file.  You can download it from
http://www.cocoaprogramming.net.  -setTarget: and -setAction methods
used with an NSImageView can be found in an init method of MYDocument.m.

Needless to say, if the program is linked against GNUstep, it terminates
immediately after it begins running, due to an exception raised
from either of the methods.


- Kazunobu Kuriyama

reply via email to

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