Re: Re-Post: Dragging out of an NSBrowser
Re: Re-Post: Dragging out of an NSBrowser
- Subject: Re: Re-Post: Dragging out of an NSBrowser
- From: Brian Webster <email@hidden>
- Date: Fri, 21 Nov 2003 20:54:52 -0600
This might be because the browser cells are actually displayed inside
an NSMatrix that's a subview of the NSBrowser, so the mouse events
would be routed to the matrix instead of the browser. You can create
your own NSMatrix subclass and implement the dragging there, then use
NSBrowser's setMatrixClass: method to tell it to create instances of
your subclass instead of plain old NSMatrix.
On Nov 21, 2003, at 1:42 PM, Michael Becker wrote:
Hello!
I am posting this again, hoping that somebody could give me a least a
little push into the right direction. Thanks!
Hi!
I am trying to kind of rebuild the Finder, only in a very limited
way. I have an NSBrowser that displays the file structure on the
harddisk. Now I would like to let people drag files out of the
NSBrowser into an NSTableView. You can already drag and drop into the
TableView from "outside", i.e. the "real" finder.
I tried to subclass NSBrowser and implement
draggingSourceOperationMaskForLocal: and mouseDragged: (as I read it
in a book about views in general). But it seems that those methods
aren't even called. Thus my question: What are the hidden secrets
when trying to drag out of an NSBrowser, i.e. to drag an
NSBrowserCell? How do I go about it?
Update: I disabled "multiple selection" for my Browser, and now the
mouseDragged: method gets called, but nothing else happens. Strangely
enough: I hardcoded the path of the file to be dragged and whenever I
drag from anywhere in the Browser-object EXCEPT from the BrowserCells
the drag and drop works. So I guess that the NSBrowserCell is causing
the trouble...
I am also surprised that there's so little information about that
exact topic as I figured that this is something that occurs in
projects quite often (e.g. in an FTP-Client that supports drag and
drop etc.)
Bye,
Michael
_______________________________________________
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.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.