🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1717

Drag and Drop API problems

#1717
From: Robert D. Nicholson
Date: Sat, 03 Oct 1992 03:00
39 lines
1532 bytes
I am trying to get a view to accept a tiff from the workspace.

I have got it working using NXFilenamePboardType in that the little
squares come up when any type of file enters the boundry of the view
now what I want is for the squares to come up only if the file
is a tiff.  ie. NXTiffPboardType.

I have this.

- initFrame:(NXRect *)frameRect
{
	const char *const types[] = {NXTIFFPboardType};
    	[super initFrame:frameRect];
	[self registerForDraggedTypes:(const char *const*)&types count:1];
    	return self;
}

- (NXDragOperation)draggingEntered:(id <NXDraggingInfo>)sender
{
	Pasteboard *pboard;
	NXDragOperation sourceMask;
	dragOK = NO;
    
	sourceMask = [sender draggingSourceOperationMask];
	pboard = [sender draggingPasteboard];
	if (sourceMask & NX_DragOperationCopy) {
		if (IncludesType([pboard types], NXTIFFPboardType)) {
			dragOK = YES;
		}
	}
	if (sourceMask & NX_DragOperationCopy) {
		if (dragOK) return NX_DragOperationCopy;
	}
	return NX_DragOperationNone;
}


This doesn't work if I replace NXTIFFPboardType with NXFilenamePboardType
any file does get accepted.
Technical Details
Message-ID: <1992Oct3.030011.25197@monu6.cc.monash.edu.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!ede978e

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!monu6!ede978e
From: ede978e@monu6.cc.monash.edu.au (Robert D. Nicholson)
Subject: Drag and Drop API problems
Message-ID: <1992Oct3.030011.25197@monu6.cc.monash.edu.au>
Summary: Drag and Drop API problems
Organization: Monash University, Caulfield Campus
Date: Sat, 3 Oct 1992 03:00:11 GMT
Lines: 40