Re: This is more of a Drag than I thought it would be
Re: This is more of a Drag than I thought it would be
- Subject: Re: This is more of a Drag than I thought it would be
- From: Brian Webster <email@hidden>
- Date: Fri, 14 Dec 2001 13:20:00 -0600
On Friday, December 14, 2001, at 01:05 PM, Joe Muscara wrote:
How about a category? Declaring "@interface NSTextField
(MyExtensions)" seems to work, implementing the dragging
methods there.
It works, but keep in mind that it will affect your app
globally, meaning that you can now drag files into _all_
NSTextFields in your app, which is probably not desirable.
Trick is now that my concludeDragOperation method had some
calls to self when it was in the controller that I now need to
send to the controller. Hmmm....
Personally, I'm not really sure why the designers originally
decided that the dragging methods should be implemented in the
view itself. It seems like a perfect place to have a delegate
handle it instead, which is something I end up doing sometimes,
just making a skeleton view subclass and having it hand off all
the responsibility to a delegate.
Firstly, be aware that there's a little "feature" in
NSOutlineView's dragging methods in that it will only start a
drag if you start the drag by clicking in the outline table
column (the one with the disclosure triangles).
Are you sure of this? Isn't the Mailbox drawer in Mail an
outline view? It lets me grab an item most anywhere and drag it
around. My app does as well, now. :) Maybe it depends upon if
vertical dragging is allowed. I haven't tried with it turned
off.
The outline view in the mailbox drawer only has one column, so a
click anywhere in the column will drag the row. But I've been
working on an app with an outline view, and it won't let me drag
from anywhere but the outline column. Maybe it has something to
do with the fact that I'm using some non-NSTextFieldCells for
drawing.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster