• 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
Re: Drag & Drop Table View - A Simple Version?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag & Drop Table View - A Simple Version?


  • Subject: Re: Drag & Drop Table View - A Simple Version?
  • From: Edwin Zacharias <email@hidden>
  • Date: Wed, 29 May 2002 20:53:49 -0400

NSTableView dataSource:

tableView:validateDrop:proposedRow:proposedDropOperation:

- (NSDragOperation)tableView:(NSTableView*)tableView validateDrop:(id
<NSDraggingInfo>)info proposedRow:(int)row
proposedDropOperation:(NSTableViewDropOperation)operation

Used by NSTableView to determine a valid drop target. Based on the mouse
position, the table view will suggest a proposed drop location. This
method must return a value that indicates which dragging operation the
data source will perform. The data source may "re-target" a drop if
desired by calling setDropRow:dropOperation: and returning something
other than NSDragOperationNone. One may choose to re-target for various
reasons (e.g. for better visual feedback when inserting into a sorted
position).


NSTableView:

setDropRow:dropOperation:

- (void)setDropRow:(int)row
dropOperation:(NSTableViewDropOperation)operation

Used if you wish to "re-target" the proposed drop. To specify a drop on
the second row, one would specify row as 2, and operation as
NSTableViewDropOn. To specify a drop below the last row, one would
specify row as [tv numberOfRows], and operation as NSTableViewDropAbove.


I believe the row you want is [tv numberOfRows] and the operation is
NSTableViewDropOn. If you need to know other stuff about drag and drop
for NSTableView look in the NSTableViewDataSource protocol.

- Edwin



On Wednesday, May 29, 2002, at 08:43 PM, Sam Goldman wrote:

> :: BEGIN PREFACE
> Well.... After my (all too) elongated sabbatical from Cocoa, I have
> returned. Now that I am back on a small project, I find myself unable to
> answer one of the questions that came to me while coding.
> :: END
>
> So I have this table view and I want the user to be able to drag some
> files/folders onto it, drop them, and have the application retrieve the
> paths and start processing. I don't need reordering of the table rows. I
> just want the entire table view to have an outline around the border.
>
> Sorry for asking such a simple (?) question. I am somewhat disappointed
> myself since I can't figure it out on my own, even two years after
> starting
> with Cocoa.
>
> - Sam (too tired to look over the e-mail and check for errors)
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Drag & Drop Table View - A Simple Version? (From: Sam Goldman <email@hidden>)

  • Prev by Date: Re: Shearing with NSAffineTransform
  • Next by Date: Re: Reconizing a symbolic or alias directory
  • Previous by thread: Drag & Drop Table View - A Simple Version?
  • Next by thread: icons for shell scripts
  • Index(es):
    • Date
    • Thread