[comp.windows.x.motif] RowColumn Child Resizing

marcs@SLC.COM (Marc San Soucie) (11/14/90)

This falls somewhere between "anomaly" and "bug". I would hope it's the
latter, so someone will feel like fixing it. If it's just an anomaly, I'd
be grateful for any advice on a workaround.

I am using a RowColumn widget with a bunch of label children as a sort of
status line, containing information describing things seen in a window. The
contents of the label children change from time to time. I am having
difficulty forcing the RowColumn widget to accomodate size changes in its
children.

The RowColumn is in a pane of a PanedWindow, but the same difficulty arises
when it is in a Form. It looks like this:

    +---+-------+---+-----------+---+-------+-----------------------+
    |   |       |   | Something | V |       |                       |
    +---+-------+---+-----------+---+-------+-----------------------+

The RowColumn is XmHORIZONTAL, ADJUST_LAST = True, no packing or column
count, and initially it displays just fine, the last child extending out to
the right border of the paned window, whose width has been determined by a
wider widget in one of the other panes.

If I change the labelString shown from 'Something' to 'Else', the bounding
box for the label child does not change in width. This is marginally
acceptable, but if I change the 'V' to 'Lawnmower', all I see is the
initial 'L'. The rest is clipped.

What is happening is that the RowColumn, upon receiving the child's request
to change size, calculates its own size with the change, and makes a
request of its parent. In this case the parent refuses, as PanedWindows
usually refuse. As a result, the RowColumn refuses the label's request, and
nothing happens.

If I use a Form as the parent, the same thing happens, UNLESS there is
another child in the same Form which is wider than the RowColumn wants to
be, in which case the Form tells the RowColumn widget 'Almost'. Having
implanted a patch to a recently reported bug about this, my RowColumn
interprets the Almost as a Yes, and voila, the child resizes, in the
process shrinking the rightmost label somewhat. Unfortunately, it is not
practical to force a larger-sized sibling into the Form, because I haven't
got anything user-useful to put there, and because I want the whole mess to
be user-resizable.


Okay, here's my point. It seems that when the RowColumn asks its parent to
resize, if the parent says No, the RowColumn should see if its current size
will satisfy the child request before refusing the child's request. In this
case it will. The extra space needed has been present all along, attached
to the last child as the 'adjust_last' stuff. In fact, in this instance it
isn't even necessary for the RowColumn to make a request of its parent - it
could accept the child resize internally.

Now is this a bug, a Good Thing, or an enhancement request?

And does anyone have a Meanwhile I could try?

    Marc San Soucie
    Servio Corporation
    Beaverton, Oregon
    marcs@slc.com