[comp.windows.x.motif] Horizontal alignment of text in labels and buttons

pjs@plato.JPL.NASA.gov (Peter Scott) (08/11/90)

I'm building a form containing labels and buttons and option menus, thus:


	BUTTON      BUTTON      BUTTON     OPTION MENU

        BUTTON      LABEL:   TEXT

I'm using default shadowing (I like it), which means that the labels
aren't shadowed but the text and button widgets are.

I have the widgets attached with ATTACH_OPPOSITE_WIDGET to keep
their bottoms aligned.  Unfortunately, since the labels don't have
borders, the text in them is lower than that in the buttons.  The
cascade button created by the option menu is created so that its
text aligns with the text in the option menu label field, but the
label field is already too low.  It looks like this (assume all text
fields are letter I's):

  -------------     -------------
 | --- --- --- |   | --- --- --- |                    -------------
 |  |   |   |  |   |  |   |   |  |    --- --- ---    | --- --- --- |
 |  |   |   |  |   |  |   |   |  |     |   |   |     |  |   |   |  |
 |  |   |   |  |   |  |   |   |  |     |   |   |     |  |   |   |  |
 | --- --- --- |   | --- --- --- |     |   |   |     |  |   |   |  |
  -------------     -------------     --- --- ---    | --- --- --- |
                                                       -------------

Same problem with the label gadget on the bottom row.  I thought I might
at least get the cascade button on the option menu aligned with the
other buttons on that row, and tried setting an ATTACH_OPPOSITE_WIDGET
resource on the widget returned by XmOptionButtonGadget for a SetValues,
but that didn't change anything.

I could kludge a solution that looked at the border widths of the
other widgets and set borders on the label widget in the background
color, but... not exactly elegant.  Better suggestions?


--
This is news.  This is your       |    Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?    |    (pjs@aristotle.jpl.nasa.gov)

ejp@bohra.cpg.oz (Esmond Pitt) (08/15/90)

In article <1990Aug10.232204.12241@elroy.jpl.nasa.gov> pjs@aristotle.jpl.nasa.gov writes:
> I'm building a form containing labels and buttons and option menus, thus:
>
>
> 	BUTTON      BUTTON      BUTTON     OPTION MENU
>
>         BUTTON      LABEL:   TEXT
>
> I'm using default shadowing (I like it), which means that the labels
> aren't shadowed but the text and button widgets are.

Increase the margins in the label and menu widgets to account for the
different default margins, borders, and shadows.


-- 
Esmond Pitt, Computer Power Group
ejp@bohra.cpg.oz
D