Important: The information in this document is obsolete and should not be used for new development.
SetControlTitle
To change the title of a control and redraw the control accordingly, use theSetControlTitle
procedure. TheSetControlTitle
procedure is also available as theSetCTitle
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
TheSetControlTitle
procedure changes thecontrlTitle
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 theNewControl
function. To determine a control's current title, use theGetControlTitle
procedure.