• 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 and Drop: Cocoa window in Carbon app...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag and Drop: Cocoa window in Carbon app...


  • Subject: Re: Drag and Drop: Cocoa window in Carbon app...
  • From: Allan Dushan <email@hidden>
  • Date: Fri, 20 Feb 2004 10:23:00 -0800

Jirome,

I have implemented all the data source calls for drag and drop in the NSTableView:

tableView:writeRows:toPasteboard:
tableView:acceptDrop:row:dropOperation:
tableView:validateDrop:proposedRow:proposedDropOperation:

They are all called correctly when I load the bundle from a Cocoa app. If I load the bundle from a Carbon app, this is were the problems start to happen. Any drags from the finder to the NSTableView are not recognized by the window, resulting in the image snapping back, and none of the data source methods being called.

Questions I have for you:
1. Is your file owner, for the nib that contains the window with the NSTableView in it, an NSWindowController or subclass of NSWindowController?
2. Are you just calling NSApplicationLoad() right after the Carbon app loads the Cocoa bundle? Or, do you also call NSApp = [NSApplication sharedApplication]?

Thanks,
Allan


On Feb 19, 2004, at 11:14 PM, Jirome Foucher wrote:

Le 20 fivr. 04, ` 00:19, Allan Dushan a icrit :

I have a Carbon app that uses a Cocoa bundle. The Carbon app loads the
Cocoa bundle and gets a function pointer to the initialization function
for the Cocoa bundle. Then through the initialization function the
Cocoa bundle displays a Cocoa window with an NSTableView in it.

If I try to drag a file from the finder to the NSTableView and release
the mouse, the file just snaps back. The NSTableView is registered to
receive NSFileContentsPboardType, but the
validateDrop:proposedRow:proposedDropOperation never gets called.

I use that technique myself and don't have any problem.....

Did you add :
- (NSDrapOperation)tableView:(NSTableView*)tv validateDrop:(id)info proposedRow:(int)row proposedDragOperation(NSDrapOperation)op

to your tableView's delegate too ?

Jirome
_______________________________________________
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 and Drop: Cocoa window in Carbon app... (From: Allan Dushan <email@hidden>)
 >Re: Drag and Drop: Cocoa window in Carbon app... (From: Jérome Foucher <email@hidden>)

  • Prev by Date: Re: How to load a nib from a path
  • Next by Date: Re: How to load a nib from a path
  • Previous by thread: Re: Drag and Drop: Cocoa window in Carbon app...
  • Next by thread: Drag and Drop: Cocoa window in Carbon app...
  • Index(es):
    • Date
    • Thread