Question

I am using SWT. I have parent Composite(level 1), that uses FormLayout and it contains among others another Composite(level 2) also of FormLayout. This Composite has several children(level 3) that are made visible and invisible depending on user input.

Problematic scenario:

  1. level 3 composites are not visible
  2. level 1 composite is resized -> this resizes level 2 composite as well
  3. user input changes -> level 3 composites are visible now
  4. problem -> level 2 composite does not resize, and level 3 composites are not all visible

I have to resize level 1 composite to make level 2 composite resize properly, which is not very user friendly. I have tried many things but did not succeed, and because it's all part of bigger application, I cannot replace FormLayout with something else.

Does anyone have opinion on this one? Is there some mechanism how to make FormLayout composites resize dynamically?

Thanks, Jan

Was it helpful?

Solution

Like every daring problem also this one had easy solution. When making level 3 composites visible, it was necessary to call getParent().layout() to make level 2 composite resize properly

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top