[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] -setTarget: and -setAction: enabled in NSImageView
From: |
Kazunobu Kuriyama |
Subject: |
[PATCH] -setTarget: and -setAction: enabled in NSImageView |
Date: |
Wed, 24 Dec 2003 02:44:39 +0900 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 |
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.
I hope these tiny paches fix the problem (at least for the
example source I mentioned).
I hope they do no harm to the rest of the library.
I would appreciate it if someone could confirm this.
2003-12-24 Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
* Source/NSImageView.m (-performDragOperation): Let target call
action.
* Source/NSImageCell.h: The super class NSCell is replaced with
NSActionCell.
--- NSImageCell.h.orig 2003-08-01 08:52:08.000000000 +0900
+++ NSImageCell.h 2003-12-24 00:46:13.000000000 +0900
@@ -29,7 +29,7 @@
#ifndef _GNUstep_H_NSImageCell
#define _GNUstep_H_NSImageCell
-#include <AppKit/NSCell.h>
+#include <AppKit/NSActionCell.h>
typedef enum {
NSScaleProportionally = 0, // Fit propoRtionally
@@ -57,7 +57,7 @@
NSImageFrameButton
} NSImageFrameStyle;
-@interface NSImageCell : NSCell
+@interface NSImageCell : NSActionCell
{
// Attributes
NSImageAlignment _imageAlignment;
--- NSImageView.m.orig 2003-06-14 00:01:11.000000000 +0900
+++ NSImageView.m 2003-12-24 02:15:53.000000000 +0900
@@ -192,8 +192,12 @@
}
else
{
+ id target = [[self cell] target];
+ SEL action = [[self cell] action];
+
[self setImage: image];
RELEASE(image);
+ [target performSelector: action];
return YES;
}
}
- [PATCH] -setTarget: and -setAction: enabled in NSImageView,
Kazunobu Kuriyama <=
Re: [PATCH] -setTarget: and -setAction: enabled in NSImageView, Kazunobu Kuriyama, 2003/12/23