Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by Robert D. Nicholson
Sat, 03 Oct 1992 03:00
Drag and Drop API problems
Author: Robert D. Nicholson
Date: Sat, 03 Oct 1992 03:00
Date: Sat, 03 Oct 1992 03:00
39 lines
1532 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads