Important: The information in this document is obsolete and should not be used for new development.
Using the Control Manager
To implement a control, you generally
These tasks are explained in greater detail in the rest of this chapter.
- use a control resource (that is, a resource of type
'CNTL'
) to describe the control- create and display the control
- determine when the user presses, clicks, or holds down the mouse button while the cursor is in the control
- respond as appropriate to events involving the control--for example, by displaying a different portion of the document when the user manipulates a scroll bar
- respond as appropriate to other events in windows that include controls--for example, by moving and resizing a scroll bar when the user resizes a window, or by hiding one window's scroll bars when the user makes a different window active
Before using the Control Manager, you must initialize QuickDraw, the Font Manager, and the Window Manager, in that order, by using the
InitGraf
,InitFonts
, andInitWindows
procedures. (See Inside Macintosh: Imaging for information aboutInitGraf
andInitFonts
; see the chapter "Window Manager" in this book for information aboutInitWindows
.)
Subtopics
- Creating and Displaying a Control
- Responding to Mouse Events in a Control
- Determining and Changing Control Settings
- Scrolling Through a Document
- Moving and Resizing Scroll Bars
- Defining Your Own Control Definition Function