Mac OS X Reference Library Apple Developer
Search

Rulers

Last Revision:
Version 1.0, 2009-06-01
This project demonstrates many of the interactions between an NSRulerView and its client view.
Build Requirements:
Xcode 3.1.2 or later, Mac OS X v10.5 or later
Runtime Requirements:
Mac OS X v10.5 or later

This project demonstrates many of the interactions between an NSRulerView and its client view. It should give you an idea how to go about this when creating a view subclass that really does something.

The principal class, RectsView, displays colored rectangles that the user can select and drag around. The RectsView puts markers in the horizontal and vertical rulers showing the placement of the rectangle; manipulating these markers changes the size of the selected rectangle. Removing a marker deletes the selected rectangle, and clicking in the ruler area creates a new rectangle. The user can also lock a rectangle down, so that the markers can't be moved.




Last updated: 2009-06-01

Did this document help you? Yes It's good, but... Not helpful...