Drawers provide additional window space for an application’s interface, and can easily be tucked away from view when not in use. Drawers are ideal for controls that are frequently used, but don’t need to be visible at all times. Figure 3-9 shows an example of a drawer in Mail.
defines the behavior of drawers.
Interface Builder provides the ability to create drawers and attach
them to windows. The window that a drawer is associated with is
called the parent
. Like windows, drawers contain a view
hierarchy. The top-level view of this hierarchy is the
NSDrawer objects in
Interface Builder have outlets connected to the
drawer’s parent window and content view.
Alternatively, you can set a drawer’s parent window
of a drawer with the method
set the content view with
When a drawer opens or closes, it slides from an edge of the parent
window. Drawers have a preferred edge of the parent window on which
they try to open. Without sufficient room between the preferred edge
and the adjacent edge of the screen display, the drawer opens on the
opposite side of the window. The preferred edge may be any side of
the window: top, bottom, left, or right. You can access this property
preferredEdge. In these methods, the edge is represented ...