Re: Newbie ImageWell question
Re: Newbie ImageWell question
- Subject: Re: Newbie ImageWell question
- From: Volker Bublitz <email@hidden>
- Date: Mon, 7 Oct 2002 22:18:09 +0200
hi,
i've set some code together here... i'm also new and noticed that it
only works if you drag and drop the file to the outer edge of the
myImageView class (a subclass of NSImageView)... don't know how to
solve this yet... nameField is the name of an IBOutlet to a NSTextField
which writes the file name... (path)
greets,
volker
#import "myImageView.h"
@implementation myImageView
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects:
NSFilenamesPboardType, nil]];
}
- (NSDragOperation)draggingEntered:(id)sender
{
return NSDragOperationCopy;
}
- (IBAction)draggingUpdated:(id)sender
{
}
- (BOOL)performDragOperation:(id)sender
{
NSPasteboard *pboard;
pboard = [sender draggingPasteboard];
NSArray *files = [pboard propertyListForType:NSFilenamesPboardType];
[nameField setObjectValue:files];
return YES;
}
@end
Am Dienstag, 08.10.02 um 02:22 Uhr schrieb Nicholas Francis:
>
Unfortunately, that always produces NULL -
>
>
I know that it is not always possible to do so (if data comes from
>
pasteboard), but just getting it to work so-so is enough, as it is for
>
a developer tool.
>
>
(and developers can live with a bit of strangeness in their tools)
>
>
Any other suggestions?
>
>
Cheers,
>
Nich
>
>
On mandag, okt 7, 2002, at 06:23 US/Pacific, Robert Cerny wrote:
>
>
> NSString *name = [[NSImageView image] name]
>
> NSLog("The image name:%@", name);
>
>
>
> HTH
>
>
HTH?
>
>
> Robert
>
>
>
> On Monday, Oct 7, 2002, at 23:02 Europe/Prague, Nicholas Francis
>
> wrote:
>
>
>
>> Hi guys. I've fretted over the docs for hours trying to figure out
>
>> how to get the filename (not the image data) of a file dropped over
>
>> an NSImageWell. Any hints? I'm getting desperate :-)
>
>>
>
>> cheer,
>
>> Nich
>
>> _______________________________________________
>
>> cocoa-dev mailing list | email@hidden
>
>> Help/Unsubscribe/Archives:
>
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
>> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.