• 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: Movable by window background AND custom NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Movable by window background AND custom NSView


  • Subject: Re: Movable by window background AND custom NSView
  • From: vance <email@hidden>
  • Date: Mon, 31 Mar 2008 10:19:31 -0700

That did it. Thank you!

On Mar 31, 2008, at 10:09 AM, Michael Ash wrote:

On Mon, Mar 31, 2008 at 12:59 PM, patrick machielse <email@hidden> wrote:
Op 31 mrt 2008, om 09:52 heeft vance het volgende geschreven:


I have a Textured Window with a NSView that has some custom drawing
done in drawRect.

When I click and drag outside the custom NSView
     The window moves
     (That is exactly what is needed)

When I click and drag within the custom NSView
     The window moves
     The custom NSView receives the mouseDragged messages

Since I am overriding mouseDragged (and most other mouse related
messages in NSResponder) I would expect for the custom NSView to
only receive the messages and since I am not calling [super
mouseXXXXX]; the message should not get outside the NSView therefore
the window should not move.

Clearly that is now what happens. The window moves when I click and
drag within the custom view which is something we dont want to happen.


Does anyone understands what is the flow of mouse events and what to
do to get around this?

The solution is to subclass NSControl instead of NSView.

Actually the solution is to override -mouseDownCanMoveWindow to return whatever is appropriate for your view.

Mike
_______________________________________________

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

_______________________________________________

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


References: 
 >Re: Movable by window background AND custom NSView (From: patrick machielse <email@hidden>)
 >Re: Movable by window background AND custom NSView (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: Subverting the first responder chain
  • Next by Date: Re: core data and sqlite db store problem
  • Previous by thread: Re: Movable by window background AND custom NSView
  • Next by thread: unpacking binary data
  • Index(es):
    • Date
    • Thread