#1090 ScrollPane help

tcolar Thu 29 Apr 2010

I'm trying to use ScrollPane

class Main
{
static Void main()
{
  Window
  {
    size = Size(300, 300)
 ScrollPane
 {
Label{text = "someverylonglabel someverylonglabel someverylonglabel someverylonglabel"},
 },
  }.open
}
}

It opens fine, but there are no scollbars (only see a part of the label).

What am I missing ??

brian Fri 30 Apr 2010

I've had a lot of trouble with the SWT scroll pane.

One thing I know for sure is it won't work as a direct child of a Window, try nesting it in a InsetPane.

Also in this case, Label does some special stuff for collapsing itself with "..." in SWT, so not sure how that fits into prefSize. Try using a ConstraintPane with some fixed sizes.

tcolar Fri 30 Apr 2010

Thanks that worked out good.

In my case I was adding the scrollPane inside a SashPane ... but just like a Window, it needed an InsetPane to work "right".

Note: I'm not actually using labels, that was just for a quick example.

Login or Signup to reply.