• 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
TableView Drag and Drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TableView Drag and Drop


  • Subject: TableView Drag and Drop
  • From: Alex Keresztes <email@hidden>
  • Date: Sun, 21 Oct 2001 15:01:04 -0500

I just signed up to this mailing list so I dont really know how things work... But i have a problem that has been bothering me that would be great if someone could help on.

I have been trying to get drag and drop reordering in the tableview i have in my project, but I am having some problems. Anyone that has used this before care to enlighten me?

The problem i was having is that the drag is started, however the tableview never runs its validate for drop or accept drop methods. Do I have to registerfordragged types or do some other implementation other than the three functions in the NSTableView.h?

Here is a little snippet of what i have:

-I am not actually doing anything here, like writing to the pasteboard or setting the new information into my data source, but merely trying to see if the behavior is working correctly. I get the first NSLog message when i drag a row, but i never get the other two. Anyone have any ideas?

- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard
{
NSLog (@"Dragging begun");
return YES;
}

- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op
{
NSLog (@"Proposed Row: %d", row);
return NSDragOperationEvery;
}

- (BOOL)tableView:(NSTableView*)tv acceptDrop:(id <NSDraggingInfo>)info row:(int)row dropOperation:(NSTableViewDropOperation)op
{
NSLog (@"Row: %d", row);
return YES;
}


  • Prev by Date: Re: Experimenting with Timers
  • Next by Date: Re: Submenu name...
  • Previous by thread: Urgent - developer asset swap
  • Next by thread: Re: TableView Drag and Drop
  • Index(es):
    • Date
    • Thread