[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: widget's layout exceeds client area, how to constrain to fixed size?

I can try adding layout data to the single child, but I'm not sure how that will fix things.

Setting layout data isn't helping. The child doesn't respect the parent's bounds.


Here are some debugs:

Without a call to shell.layout(true):
  Shell Client Area = Rectangle {0, 0, 563, 445}
  Child Client Area = Rectangle {0, 0, 0, 0}

With a call to shell.layout(true):
  Shell Client Area = Rectangle {0, 0, 563, 445}
  Child Client Area = Rectangle {0, 0, 558, 379}

And now my child respects the parent's bounds.

I've tried calling shell.open() before adding children and shell.open() after adding the children, doesn't make a difference. Still need to call layout().

Why do I need to call layout after adding the widgets for the first time? I can understand calling layout if the data changes or the widget was already materialized onscreen. Maybe I am stuck with an AWT/Swing perspective and need to read up on SWT more.