Change NSTableView Drop Highlight (ugly black box)

  • Hi all,

    Yet another question that seems to be floating around without
    (easily obtainable) answer on the list and web:

    How can I change the properties (hell, just the color and thickness
    would be nice..) of the ugly black box you get by default on Drag/
    Drop with an NSTableView?

    Thanks in advance,
    Brian Amerige
    http://extendmac.com
  • This is a FAQ - funny enough, the words 'ugly black' are the
    easiest search terms with which to find the many complaints about
    it. :-)

    http://www.cocoadev.com/index.pl?
    UglyBlackHighlightRectWhenDraggingToNSTableView

    http://www.cocoabuilder.com/search/archive/cocoa?words=ugly+black

      Hope this helps.

    --
    I.S.

    On Oct 13, 2006, at 9:47 PM, Brian Amerige wrote:

    > Hi all,
    >
    > Yet another question that seems to be floating around without
    > (easily obtainable) answer on the list and web:
    >
    > How can I change the properties (hell, just the color and
    > thickness would be nice..) of the ugly black box you get by default
    > on Drag/Drop with an NSTableView?
    >
    > Thanks in advance,
    > Brian Amerige
    > http://extendmac.com
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
    > 40gmail.com
    >
    > This email sent to <idiotsavant2005...>
  • I ordinarily reply on the list, so, terribly sorry for that last
    time. It was an accident, obviously.

    As for the fillRoundRectInRect bit, I did check the
    NSBezierPathCategory page referenced, and as far as I can see, it
    doesn't (or no longer) contains +fillRoundRectInRect. This may be my
    own oversighting, but if you can find it there, I'd love to know
    where you found it!

    Thanks,
    Brian Amerige
    http://extendmac.com

    On Oct 13, 2006, at 11:38 PM, I. Savant wrote:

    >
    > 1 - Please reply on-list so others can help. I participate in
    > helping others on-list because it benefits anyone else who searches
    > the archives for similar answers in the future. Taking the
    > discussion off-list turns it into a private help session that does
    > not support the community.
    >
    > 2 - You should always read the entire source people reference for
    > you. Directly after the code example you used is the sentence, "...
    > the above uses +fillRoundRectInRect which is a NSBezierPath
    > Category Method found on the NSBezierPathCategory page." Follow the
    > link to the referenced page for the code for the category on which
    > that example depends.
    >
    > --
    > I.S.
    >
    >
    > On Oct 13, 2006, at 11:12 PM, Brian Amerige wrote:
    >
    >> Hmm, that example in the cocoa-dev (first code segment) gives me
    >> this error when I try to drag:
    >>
    >> +[NSBezierPath fillRoundRectInRect:radius:]: selector not recognized
    >> 2006-10-13 23:11:34.392 Edge[1863] *** Canceling drag because
    >> exception 'NSInvalidArgumentException' (reason '*** +[NSBezierPath
    >> fillRoundRectInRect:radius:]: selector not recognized') was raised
    >> during a dragging session
    >>
    >> Any ideas?
    >> Brian Amerige
    >> http://extendmac.com
    >>
    >>
    >> On Oct 13, 2006, at 10:04 PM, I. Savant wrote:
    >>
    >>>
    >>> This is a FAQ - funny enough, the words 'ugly black' are the
    >>> easiest search terms with which to find the many complaints about
    >>> it. :-)
    >>>
    >>> http://www.cocoadev.com/index.pl?
    >>> UglyBlackHighlightRectWhenDraggingToNSTableView
    >>>
    >>> http://www.cocoabuilder.com/search/archive/cocoa?words=ugly+black
    >>>
    >>> Hope this helps.
    >>>
    >>> --
    >>> I.S.
    >>>
    >>>
    >>> On Oct 13, 2006, at 9:47 PM, Brian Amerige wrote:
    >>>
    >>>> Hi all,
    >>>>
    >>>> Yet another question that seems to be floating around without
    >>>> (easily obtainable) answer on the list and web:
    >>>>
    >>>> How can I change the properties (hell, just the color and
    >>>> thickness would be nice..) of the ugly black box you get by
    >>>> default on Drag/Drop with an NSTableView?
    >>>>
    >>>> Thanks in advance,
    >>>> Brian Amerige
    >>>> http://extendmac.com
    >>>>
    >>>>
    >>>> _______________________________________________
    >>>> Do not post admin requests to the list. They will be ignored.
    >>>> Cocoa-dev mailing list      (<Cocoa-dev...>)
    >>>> Help/Unsubscribe/Update your Subscription:
    >>>> http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
    >>>> 40gmail.com
    >>>>
    >>>> This email sent to <idiotsavant2005...>
    >>>
    >>
    >
  • That page has indeed changed and the referencing page has not been
    updated. Feel free to do so.

      Browsing the referenced page's history, however, reveals the
    method was there. I believe this will directly link you to that
    version of the page:

    http://www.cocoadev.com/index.pl?NSBezierPathCategory4

    --
    I.S.

    On Oct 14, 2006, at 12:32 AM, Brian Amerige wrote:

    > As for the fillRoundRectInRect bit, I did check the
    > NSBezierPathCategory page referenced, and as far as I can see, it
    > doesn't (or no longer) contains +fillRoundRectInRect. This may be
    > my own oversighting, but if you can find it there, I'd love to know
    > where you found it!
  • Hi Brian,

    If you replace the calls to the missing methods with the following,
    this should fix your problem:

    // [NSBezierPath fillRoundRectInRect:drawRect radius:4.0];
    [[NSBezierPath bezierPathWithRoundRectInRect:drawRect radius:4.0]
    fill];

    // [NSBezierPath strokeRoundRectInRect:drawRect radius:4.0];
    [[NSBezierPath bezierPathWithRoundRectInRect:drawRect radius:4.0]
    stroke];

    Regards,
    Jon Trainer
    http://outerlevel.com

    On Oct 14, 2006, at 12:35 AM, <cocoa-dev-request...> wrote:

    > ------------------------------
    >
    > Message: 16
    > Date: Sat, 14 Oct 2006 00:32:27 -0400
    > From: Brian Amerige <brian...>
    > Subject: Re: Change NSTableView Drop Highlight (ugly black box)
    > To: <cocoa-dev...>
    > Message-ID: <EFBBF9DC-95FD-4007-9258-16A6BFA845B1...>
    > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
    >
    > I ordinarily reply on the list, so, terribly sorry for that last
    > time. It was an accident, obviously.
    >
    > As for the fillRoundRectInRect bit, I did check the
    > NSBezierPathCategory page referenced, and as far as I can see, it
    > doesn't (or no longer) contains +fillRoundRectInRect. This may be my
    > own oversighting, but if you can find it there, I'd love to know
    > where you found it!
    >
    > Thanks,
    > Brian Amerige
    > http://extendmac.com
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today