Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 5 - Control Manager / Control Manager Reference
Control Manager Routines / Changing Control Settings and Display


SetControlTitle

To change the title of a control and redraw the control accordingly, use the SetControlTitle procedure. The SetControlTitle procedure is also available as the SetCTitle procedure.

PROCEDURE SetControlTitle (theControl: ControlHandle; 
                           title: Str255);
theControl
A handle to a control, the title of which you want to change.
title
The new title for the control.
DESCRIPTION
The SetControlTitle procedure changes the contrlTitle field of the control record to the given string and redraws the control, using the system font for the
control title.

The Control Manager allows multiple lines of text in the titles of buttons, checkboxes, and radio buttons. When specifying a multiple-line title, separate the lines with the ASCII character code $0D (carriage return). If the control is a button, each line is horizontally centered, and the font leading is inserted between lines. (The height of each line is equal to the distance from the ascent line to the descent line plus the leading of the font used. Be sure to make the total height of the rectangle greater than the number of lines times this height.) If the control is a checkbox or a radio button, the text is justified as appropriate for the user's current script system, and the checkbox or button is vertically centered within its rectangle.

When you create a control, you specify an initial title either in the control resource or in the title parameter of the NewControl function. To determine a control's current title, use the GetControlTitle procedure.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996