Specifies how much empty space is left on each side between an object edges and its contents.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
set the margins of object to {pixels | left, top, right, bottom}
# Examples
set the margins of group ID 8 to 20 -- sets all four margins
set the margins of button myButton to 2,10,2,10
set the margins of field "Info" to three
# Description
Use the margins property to control how close text within a button or field can come to the object edges, how close objects in a group can come to the group edges, and how the label of a graphic is displayed.
If a single integer is specified, all four margins of the object are set to that number of pixels. If four integers are provided, the object's top, left, bottom, and right margins are set to each one respectively:
* item 1 of the margins property is equal to the leftMargin * item 2 of the margins is equal to the topMargin * item 3 is equal to the rightMargin * item 4 is equal to the bottomMargin
If the lookAndFeel is set to "Motif", controls require two pixels of margin space for the border that shows when the control is active control. To avoid interfering with this border on Unix, set the margins property of groups to at least 2 if the group contains controls whose traversalOn property is set to true.
>*Important:* The margins of an object include the > 2-pixel space required for the focus border, even if the lookAndFeel > is not "Motif". This means that 2 is the smallest usable margin, > rather than zero. For example, if the margins of a field > is set to zero, a few pixels at the edge of the > field text may be cut off.
# Tags
ui,
# See
- **keyword:** image, integer, button, scrollbar, graphic, player, field, control - **property:** topMargin, pixels, formattedWidth, textAlign, formattedHeight, wideMargins, boundingRect, rectangle, rightMargin, bottomMargin, label, lookAndFeel, leftMargin, traversalOn - **command:** group - **object:** field - **glossary:** object, property, pixel, group, Unix, control, non-negative, integer