• 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: Drag from view with nested view content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag from view with nested view content


  • Subject: Re: Drag from view with nested view content
  • From: Brian Webster <email@hidden>
  • Date: Fri, 2 May 2003 09:35:17 -0500

On Thursday, May 1, 2003, at 03:42 PM, email@hidden wrote:

I have a custom view that contains other views, yet I want to initiate a drag
from the entirety of the top view (command clicking anywhere within the top
view starts a drag). What is the easiest/simplest way to marshall all the
mouseDown handling to get this to happen? Do I need to override mouseDown:
with all the interior views and pass control up to the superview? Some of
the interior views need to respond to clicks. Command clicks would start a
drag.

You should override the hitTest: method (declared in NSView) in your top view. This method is called to determine which view a mouse event should be sent to. If you want to hide clicks from the subviews in some instances, just return self in those cases, and return [super hitTest:theEvent] in others.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: NSTextStorage and NSTextAttachment
  • Next by Date: Re: NS/OS Developer tools for Windows?
  • Previous by thread: Drag from view with nested view content
  • Next by thread: help with launching a separate application
  • Index(es):
    • Date
    • Thread