1

I'm trying to create a Composite containing FlowLayout inside a ScrolledComposite so that the Composite inherits its width from the ScrolledComposite but grows in height dynamically. I've searched some snippets but I'm not getting them to work; I can only get it to grow in width which is not desirable.

What I'm trying to do is to create a View containing a bunch of thumbnails to fill the window/surrounding composite in width and scroll in height.

Hultner
  • 3,710
  • 5
  • 33
  • 43

1 Answers1

0

You will need to override the computeSize method of the composite, or the FillLayout to always report back the given widthHint, unless perhaps the width hint is smaller than a single thumbnail's width in which case you might want to show horizontal scroll).

There could also a possibility that you add a resize listener to ScrollComposite and keep calling ScrollComposite#setMinSize() to ensure the composite inside only grows vertically.

Also are you using the correct type on FillLayout?

Waqas Ilyas
  • 3,116
  • 1
  • 17
  • 27