Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Version: 1.0

Posted: 2003-01-30

Build Requirements: N/A

Runtime Requirements: Carbon

View Source Code:

Download Sample (“DragWindowGrid.zip”, 16.1K)
Download Sample (“DragWindowGrid.dmg”, 90.2K)


DragWindowGrid- a sample showing how to write a function to drag a window around on the screen so that it can only be released along grid lines. No patches, no hooking into drag procs, nothing fancy. This just tracks an XOR frame around the screen similar to how the Window Manager behaves, and when you let go in a different spot MoveWindow moves the window to the right place. DrawCode.c has the DragWindowGrid routine in it. You can change the kIncrement constant to change the size of the grid rects. Keywords: grid, window, MoveWindow, Window Manager

Document Revision History

Date Notes
2003-01-30First Version

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.