| [news.eclipse.platform] Re: Eclipse ScrolledForm not scrolling. |
Ketan Padegaonkar wrote:
> Hi,
>
> I've got an eclipse scrolled (V_SCROLL) that should scroll vertically.
>
> However adding a lot of controls to the form does not make the form scroll.
>
> Is there something obviously wrong that I'm doing?
>
> This is the code snippet where I'm creating a lot of hyperlinks that
> should be shown in using a rowlayout, that should wrap, and the form
> should scroll vertically when there's too many hyperlinks that do not
> fit in the viewable area.
To add to this. The scroll bar becomes visible and flickers when the
form is resized and disappears when you stop resizing the form.
Is this a known issue ?
> --- begin code snippet ---
>
> public static void main(String[] args) {
> Display display = new Display();
> Shell parent = new Shell(display, SWT.DIALOG_TRIM | SWT.RESIZE);
> parent.setLayout(new FillLayout());
>
> FormToolkit formToolkit = new FormToolkit(parent.getDisplay());
>
> final ScrolledForm form = new ScrolledForm(parent, SWT.V_SCROLL);
> form.setBackground(formToolkit.getColors().getBackground());
> form.setForeground(formToolkit.getColors().getColor(IFormColors.TITLE));
> form.setExpandHorizontal(true);
> form.setExpandVertical(true);
> form.setFont(JFaceResources.getHeaderFont());
> form.getBody().setLayout(new RowLayout());
> form.setText("Hello, Eclipse Forms");
>
> for (int i = 0; i < 200; i++)
> formToolkit.createHyperlink(form.getBody(), "hyperlink-" + i,
> SWT.NONE);
>
> parent.setSize(300, 400);
> parent.open();
>
> while (!parent.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
>
> --- end code snippet ---
>
--
Ketan Padegaonkar
I blog... therefore I am... http://ketan.padegaonkar.name/
The farther you go, the less you know.
-- Lao Tsu, "Tao Te Ching"
Attachment:
signature.asc
Description: OpenPGP digital signature