Sizing parts automatically
To have the visual parts within a window size automatically when you size the window, you must set their framingSpec properties. A part's framingSpec describes how the part's visual properties, its height, width and position within the window, change when the window is sized. You can set a part's framingSpec relative to the window that contains it or you can set it so that its size and position are relative to other parts or siblings that are also within the same window. In most cases, you'll do both.
For this application, let's change the part properties of the Drop-down List part so its width automatically sizes when the Window part's width changes.
To have the parts size automatically, do the following:
1. Open the Properties window for the
Security name Drop-down List part and select the
value cell for the
framingSpec property. Select
to display the Framing Spec window.
2. At the top of the Framing Spec window, select Right to work with the part's right edge attachment.
This means that you want to attach the right-hand edge of the part to another part.
3. From the Attachment type drop-down list, select XmATTACHFORM.
This means that you want to attach the right-hand edge of the child part to the right-hand edge of the parent part, in this case the window.
4. In the Offset field, type 10.
This means that the right-hand edge of the child part will be offset by 10 pixels from the right-hand edge of its parent part at all times.
5. Click anywhere on the Composition Editor to apply the properties changes.
6. Size the Window part in the Composition Editor to see the effects of your changes.
For more information on taking full advantage of attachments to perform automatic sizing, refer to the Visual Programming User Guide.
Last modified date: 07/23/2020