• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Drag&Dropping in outlineViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag&Dropping in outlineViews


  • Subject: Drag&Dropping in outlineViews
  • From: Roberto Esposito <email@hidden>
  • Date: Fri, 2 May 2003 14:57:00 +0200

Hi,
I searched the docs and had a look to the examples in the Developer
folder, but I'm still puzzled about allowing an outline view to
handling drag and drop.

In the outline view I implemented the following methods as follows:

- (BOOL)outlineView:(NSOutlineView *)outlineView
writeItems:(NSArray*)items toPasteboard:(NSPasteboard*)pboard {
NSLog(@"dragging");
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType]
owner:nil];
[pboard setString:@"prova" forType:NSStringPboardType];
return YES;
}


- (BOOL)outlineView:(NSOutlineView*)olv acceptDrop:(id
<NSDraggingInfo>)info item:(id)item childIndex:(int)index {
NSLog(@"acceptDrop");
return YES;
}

- (unsigned int)outlineView:(NSOutlineView*)olv validateDrop:(id
<NSDraggingInfo>)info proposedItem:(id)item
proposedChildIndex:(int)childIndex {
NSLog(@"validateDrop");
return NSDragOperationGeneric;
}

The implementation is trivial since I'm only testing if everything
works before starting the hard part. The problem that puzzles me is
that outlineView:acceptDrop:item:childIndex: and
outlineView:validateDrop:proposedItem:proposedChildIndex: are never
called even if the first method is actually called. I don't know if I
have to implement something more to enable the desired behavior...

Any ideas?

Thanks in advance,
Roberto
_______________________________________________
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.

  • Follow-Ups:
    • Re: Drag&Dropping in outlineViews
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: [NSBezierPath appendBezierPathWithGlyph:inFont:] and current graphics port
  • Next by Date: CGImageRef and PNG image
  • Previous by thread: NSTableView - edited text turns white?
  • Next by thread: Re: Drag&Dropping in outlineViews
  • Index(es):
    • Date
    • Thread