Re: NSImageView's valuePath/valueURL bindings read-only but sending NSImage data?
Re: NSImageView's valuePath/valueURL bindings read-only but sending NSImage data?
- Subject: Re: NSImageView's valuePath/valueURL bindings read-only but sending NSImage data?
- From: George Orthwein <email@hidden>
- Date: Thu, 11 May 2006 15:19:12 -0400
Well it turns out that I had to subclass NSImageView to get the file
path of the image dropped onto it anyway. So here is how I got the
valuePath binding to work:
Added to my NSImageView subclass:
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
// store image path in Core Data store of current document
NSString *path = [[[sender draggingPasteboard]
propertyListForType:@"NSFilenamesPboardType"] objectAtIndex:0];
[[[[NSDocumentController sharedDocumentController] currentDocument]
docPrefs] setValue:path forKey:@"bgImagePath"];
//[super concludeDragOperation:sender];
}
Removing the call to super blocks the NSImageView from accepting the
image and sending NSImage data via the valuePath binding (which is
supposed to be read only). However, it still *receives* the image
path via the binding as it should and updates accordingly.
I'm thinking this is a bug now and will file it.
Hope this helps someone in the future,
George
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden