DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing a SCOadmin manager

Widget alignment

The general SCOadmin style for displaying widgets on secondary dialogs is to have right-justified text labels to the left of each widget with a colon following the text label, for example:

   Filename: [          ]
   

Owner: [ ]

Different graphical displays and fonts result in varying sizes for the text label, plus the issue of localized text, makes lining up labels and widgets very difficult. A set of convenience functions are supplied to ensure labels and widgets are correctly aligned: VxAlignedForm is particularly useful and highly recommended. SaAlignedForm is identical to VxAlignedForm, except it expects the text labels to be localized module IDs. VxAlignedForm takes a list of labels and widgets and creates a column of label/widget pairs inside separate forms. It also ensures that each label will occupy the same amount of horizontal space as the largest label, and similarly for the widgets.

The following call implements the described layout:

   set alform [SaAlignedForm $dialog.alform \
   		 [list \
                       [list SCO_GUIAPP_MSG_FILENAME \
                             [list VtText -value $filename -columns 25] \
   			] \
                       [list SCO_GUIAPP_MSG_OWNER \
                             [list VtText -value $owner -columns 10] \
   			] \
                ] \
   		]

If you do not want all the widgets to be the same size (for example, to prevent the owner widget from being stretched to 25 columns) you can detatch the right side of the widget from its enclosing form:

   VtSetValues [VxGetVar $alform widget2] -rightSide NONE

Next topic: Two-lists
Previous topic: Using secondary dialogs

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005