Re: Highlighting a valid drop target (serious dead end)
Re: Highlighting a valid drop target (serious dead end)
- Subject: Re: Highlighting a valid drop target (serious dead end)
- From: Corbin Dunn <email@hidden>
- Date: Thu, 20 Apr 2006 09:34:58 -0700
On Apr 16, 2006, at 1:53 PM, Keith Blount wrote:
A private table/outline view method handles the
highlighting of the drop target, namely:
-(void)_drawDropHighlightOnRow:(int)rowIndex
I don't recommend overriding private methods; it can cause
compatibility issues with future releases. Unfortunately, there isn't
an easy way to customize the drop highlighting. What is it not doing
that you want it to do?
Override that method in your outline view subclass and
draw your own highlight around the row there.
(Obviously the usual warnings apply with regard to
using a private method - you might want to implement
-drawDropHighlightOnRow: as well, just in case Apple
make this method public soon.)
Please don't do this -- speculating about potential method names is a
bad idea. What if your speculative implementation calls the private
method _drawDropHighlightOnRow. Then, what if NSTableView adds
drawDropHighilghtOnRow, and the old _drawDropHighlightOnRow then calls
drawDropHighilghtOnRow; it is very easy to accidentally introduce an
infinite loop in cases like this.
One of the best things you can do if you need to override a private
method is to let Apple know. Please log a feature request or bug! The
more track record Apple has of people wanting particular features, the
more likely it will get done. Searching for _drawDropHighlightOnRow
reveals quite a few hits...so quite a few people are probably wanting
that method. That's good to know!
thanks!
-corbin
HTH,
Keith
--- ORIGINAL MESSAGE ---
Hi,
I am asking for help one more time, because all my
efforts (been working for
nights now) have seriously come to a dead end.
In my apps view I use DND to alter the data in its
model (by dragging from a
NSTableView to a NSOutlineView). I already changed the
drag image to fit
into my apps overall design. But since then I used
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item
And
- (unsigned int)outlineView:(NSOutlineView*)olv
validateDrop:(id
<NSDraggingInfo>)info proposedItem:(id)item
proposedChildIndex:(int)childIndex
As well as
- (NSDragOperation)draggingEntered:(id
<NSDraggingInfo>)sender,
to alter the visualization of valid drop targets (in
my outline view) as
well. But - although I was able to �add�
some highlighting behaviour when
dragging to a valid destination - I just can�t
get rid of the default black
rectangle cocoa provides in such a case.
Who is responsible for creating this? What method do I
have to override to
replace it by my own drop target highlighting
behaviour?
Is there something about it somewhere in the
documentation?
Any suggestions appreciated,
Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden