• 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
Re: Need the Why and How of mouseDragged:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need the Why and How of mouseDragged:


  • Subject: Re: Need the Why and How of mouseDragged:
  • From: Alastair Houghton <email@hidden>
  • Date: Thu, 13 Dec 2007 15:34:09 +0000

On 13 Dec 2007, at 14:30, Jerry Krinock wrote:

I'm implementing drag and drop in a custom view (i.e., a subclass of NSView). It works if I send dragImage:at:offset:eventpasteboard:source:slideBack: in mouseDown:, except that the only [event type] I ever receive in mouseDown: is NSLeftMouseDown. So I can't distinguish clicks from drags. If I set a drag image unconditionally, the image flashes on the screen if the user only clicks, which is annoying.

It seems that mouseDragged: would be more sensible method from which to send dragImage:at:offset:eventpasteboard:source:slideBack:. But I never get any mouseDragged:messages. Reading the list archives, I get the impression that there might be some kind of trick to getting these, but I can't find the trick.

There's no trick here. The problem you're seeing is most likely that RBSplitView is running a mouse tracking loop when it gets -mouseDown:, which is eating all the -mouseDragged events.


Unfortunately, if a view uses this style of mouse tracking, it's difficult to add additional code to do something different (unless the view has adequate hooks built into it) without modifying the original source code or re-implementing the existing behaviour.

It would be worth considering whether you should be implementing your drag & drop on the RBSplitView subclass itself or whether your code really belongs in a child view of the RBSplitView.

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Need the Why and How of mouseDragged:
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >Need the Why and How of mouseDragged: (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: printf
  • Next by Date: Re: printf
  • Previous by thread: Need the Why and How of mouseDragged:
  • Next by thread: Re: Need the Why and How of mouseDragged:
  • Index(es):
    • Date
    • Thread