[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] How to avoid paint merging ?

I need to display large amount of data on a custom widget (subclassed from canvas) , loading the data from database takes a considerable amount of time. So I want to fetch the data in smaller bunches while displaying placeholders fo all elements that are not loaded yet.
On windows everythings works ok, but on MacOSX the paint requests seem to get merged, the os just waits until everything is loaded (which makes the app feel very slow).


How can I avoid that ?

control.update() and display.update() both have no effect.


Short snippet to illustrate what i want to do :

Canvas control = new Control(Display.getCurrent(), SWT.NO.BACKGROUND)
control.addPaintListener(new PaintListener(){
   public void paintControl(PaintEvent event){
     	for(int i=0;i<10;i++){
		//load data
		..
		//paint data on event.gc
			//paint elements that are already loaded
			...
			//paint placeholders for the remaining elements
			...
		//Paint requests must be procesed NOW
		this.update(); //no effect ?!
	}
	
     }
});

Regards,
Yves Harms