• 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
Drag-n-Drop of NSCells to/from an NSMatrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag-n-Drop of NSCells to/from an NSMatrix


  • Subject: Drag-n-Drop of NSCells to/from an NSMatrix
  • From: Brad Werth <email@hidden>
  • Date: Thu, 09 Aug 2001 10:02:39 -0700
  • Organization: ORCAS, Inc.

I am trying to do drag-n-drop of some NSCell subclass instances to and
from my NSMatrix subclass. The desired behavior is this: On mousedown,
highlight the cell -- if the user then drags the mouse, start the
drag-n-drop. This allows for cells to be selected without starting the
dragging session unless the user intentionally drags the mouse. I have
implemented this by my NSCell overriding startTrackingAt:inView: to do
the hilight and continueTracking:at:inView to start the drag.

It works great but for this: Both of those methods are called from
NSCell trackMouse:inRect:ofView:untilMouseUp: which, after calling
continueTracking, blocks -- waiting for a mouseUp event. But since my
implementation of continueTracking initiates a drag session, the mouseUp
is captured for THAT purpose instead. The end result is that after
doing a drag-n-drop, my app will ignore all events until I click the
mouse again -- I can't even command-Q to quit.

Not sure how to avoid this problem -- is there an accepted design for
this sort of thing that avoids this problem? If I keep going down this
road then I think my next step will be spoofing a mouseUp event to occur
when the dragging session ends (which I'm not certain how to pursue).
This seems a little kludgy and I could imagine some wacky
side-effects... any advice?

Thanks,
Brad Werth
email@hidden


  • Prev by Date: Windows without traffic lights
  • Next by Date: Re: Sherlock and my Sad Source Search Story
  • Previous by thread: Re: Windows without traffic lights
  • Next by thread: newbie question on contextual menus
  • Index(es):
    • Date
    • Thread