[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: Eclipse ScrolledForm not scrolling.



I suffered many flicking problems with the ScrolledForm. First you should check the .reflow() method I think thats what you need know.
But if you have a content provider and it updates too often the form will be really ugly flicking, shaking, blinking while being updated, to avoid that I avoid calling .reflow() and I use this code I copied from somewhere else (pasted blow). Also, before using the ScrolledForm I used
a Scrolled composite with another composite inside and what I did to show the scrollbars was something like


control.setRedraw(false);
control.layout()
Point controlSize = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
control.setSize(controlSize);
scrolled.setMinSize(controlSize);
control.setRedraw(true);

where control is the composite inside the scrolled composite.
But in linux at least the eclipse IDE views with scrollbars also flick :(. may be is a gtk problem I dont know, looks bad.



check this too: protected void reflow(Composite comp, boolean flushCache) { if(comp.isDisposed()) { return; } Composite c = comp; /*set redraw to false for every parent until reaching a scrolled*/ while (c != null) { c.setRedraw(false); c = c.getParent(); if (c instanceof ScrolledForm) { break; } } /* layout every parent until reaching a scrolled and reflowing it*/ c = comp; while (c != null) { c.layout(true); c = c.getParent(); if (c instanceof ScrolledForm) { ((ScrolledForm) c).reflow(flushCache); break; } } /*set redraw to TRUE for every parent until reaching a scrolled*/ c = comp; while (c != null) { c.setRedraw(true); c = c.getParent(); if (c instanceof ScrolledForm) { break; } } }