• 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
Dragging from NSTableView...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dragging from NSTableView...


  • Subject: Dragging from NSTableView...
  • From: "Bell, Carl" <email@hidden>
  • Date: Wed, 14 Nov 2001 13:09:02 -0600
  • Thread-topic: Dragging from NSTableView...

Howdy,

I am trying to drag from an NSTableView and am having difficulties
dragging to other applications, although I can drag to the Finder
and create a clipping file.

I've implemented tableView:writeRows:toPasteboard in my NSTableView's
datasource, and it is getting called. FWIW, here's the code:

- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray*)rows
toPasteboard:(NSPasteboard*)pboard
{
[pboard declareTypes:[NSArray arrayWithObjects: NSStringPboardType,
nil] owner:nil];
[pboard setString:@"ack!" forType:NSStringPboardType];
return YES;
}

Right now, I'm just trying to get the string "ack!" to work. If I drag
to the Finder, it creates a clipping file called "ack!.textclipping"
which does contain the text "ack!". I can drag this clipping to other
apps and it works. But for the life of me I can't get it to drag to
another app, e.g., TextEdit, directly.

I suppose I've missed something. Is there other setup type stuff that
I need to do, similar to registerForDraggedTypes:? My app can drag
from an NSTextView (in the same window as my NSTableView) to other apps
just fine.

Any help at all would be appreciated.

-cb

________________________________________________________________________
Carl W. Bell <http://www.baylor.edu/~Carl_Bell/index.html>
Sr. Analyst/Programmer Baylor University Academic Technology Center


  • Prev by Date: Re: Modifier keys
  • Next by Date: Re: Dragging from NSTableView...
  • Previous by thread: Re: Graph out of data
  • Next by thread: Re: Dragging from NSTableView...
  • Index(es):
    • Date
    • Thread