my problem is that if my Scrolled Composite has
scrolledWrapper.setExpandHorizontal(true);
scrolledWrapper.setExpandVertical(true);
it expands correctly on the whole ViewPart but if I shrink the View no scrollbars appear.
If I don't set the expand the scrollbars appear but the whole composite inside the scrolled composite dont expand.
GridLayout gridLayout = new GridLayout(1, true);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
ScrolledComposite scrolledWrapper = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
scrolledWrapper.setLayout(gridLayout);
// if set the scrollbars dont appear but the composite expand on the whole view
scrolledWrapper.setExpandHorizontal(true);
scrolledWrapper.setExpandVertical(true);
scrolledWrapper.setLayoutData(gridData);
scrolledWrapper.setBackground(Display.getCurrent().getSystemColor(BG_COLOR));
Does someone know how I can set the Composite to expand onto my whole view but also show the scrollbars when the view is to shrinked?
I've found a solution:
You need to set a min size. The composite needs to know at which size it's to small
scrolledWrapper.setMinSize(wrapper.computeSize(SWT.DEFAULT, SWT.DEFAULT));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.