Setting a Form’s Appearance
Generally, you’ll use Interface Builder to modify the appearance of a form. But you can also modify it programmatically, with the methods described here.
Use these NSForm methods to set the appearance of all the entries in a form:
To set the font of the entries’ titles or text fields, use
setTitleFont:orsetTextFont:.To set the alignment of the entries’ titles or text fields, use
setTitleAlignment:orsetTextAlignment:., with one of these as the argument:NSRightTextAlignment,NSCenterTextAlignment, orNSLeftTextAlignment.To set the spacing between entries (in pixels), use
setInterlineSpacing:.To set the width of the entries (including their titles and text fields), use
setEntryWidth:.To set how the text fields are outlined, use
setBordered:andsetBezeled:. A border is a thin line around the field. A bezel is an outline shaded to look three-dimensional. If both of these are set toNO, then the text fields are not outlined.
Use the NSFormCell methods in the following list to set the appearance of one of the entries in a form. You can access a particular entry with cellAtIndex:; for example, [myForm cellAtIndex:1].
To set the font of an entry’s title or text field, use
setTitleFont:orsetTextFont:.To set the alignment of the entries’ titles or text fields, use
setTitleAlignment:orsetTextAlignment:., with one of these as the argument:NSRightTextAlignment,NSCenterTextAlignment, orNSLeftTextAlignment.To set the title of an entry, use
setTitle:. If you want the title to contained styled text, usesetAttributedTitle:.
Copyright © 2002 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2002-11-12