I've spent hours on this, and the behavior seems completely random to
me. Hoping someone can clue me in on the magic incantation.
I have a form where the left hand side has a tree, and the content of
the right-hand side varies depending on the tree selection. Regardless
of what is selected in the tree, the width of the form shouldn't change,
so everything should get laid out on the right side to fill the
available space.
Everything uses GridLayout, and all GridDatas are set to fill horizontal.
When I change the tree selection, sometimes the components are drawn
correctly and exactly fill the available space. Sometimes they aren't
wide enough (fill horizontal seems to be ignored) leaving excess white
space, and sometimes they are too wide (so they extend beyond the page
boundaries).
However, if I resize the window, everything snaps to exactly the right
size. This seems to me to indicate that all of my layout, griddata,
etc. stuff is right, and that the layout just isn't being re-calculated
as needed when a tree selection changes.
So I've tried calling pack, layout, reflow, getParent.pack,
getParent.layout(true, true), calling these various calls on many
different combinations of the form, the body of the form, the composite
for the right side of the form, individual components -- nothing seems
to work.