• 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: Snapping windows while moving
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Snapping windows while moving


  • Subject: Re: Snapping windows while moving
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 13 Mar 2013 10:34:35 -0500

On Mar 12, 2013, at 3:11 PM, Steve Mills wrote:

> What's the best way to go about snapping windows to screens and other windows while dragging the window? I've tried catching it in windowDidMove (only when the mouse is down), but that isn't called for every single movement of the mouse. I haven't been able to find anything equivalent to the old kEventWindowBoundsChanging with kWindowBoundsChangeUserDrag, which was exactly what was needed to do this. It needs to be available in 10.7 on up.

The Window Server moves most windows entirely without involving the app (until the move is completed).  If you want to change how windows get moved, I think you have to take over the whole process.  You do [window setMovable:NO] to make the Window Server not move your windows itself.  Instead, you get the relevant mouse events and you write typical mouse drag code and change the window frame manually.  See the docs for -[NSWindow isMovable].

Regards,
Ken


_______________________________________________

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: Snapping windows while moving
      • From: Steve Mills <email@hidden>
References: 
 >Snapping windows while moving (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Snapping windows while moving
  • Next by Date: Re: how to implement iphoto like animation while doing drag and drop on custom listview
  • Previous by thread: Re: Snapping windows while moving
  • Next by thread: Re: Snapping windows while moving
  • Index(es):
    • Date
    • Thread