[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] problem updating Text
|
- From: jda <jdaues@xxxxxxxx>
- Date: Wed, 21 May 2003 11:23:48 -0600
- Newsgroups: eclipse.platform.swt
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
I have a page with the contains two components:
a Canvas with an Image
Text (showing year #)
I have a loop which does some calculations, updates & displays the
image, and updates the year.
As it loops thru, the image changes with each year.
The problem is that the year does not change with each year.
It starts out as 0, stays that way until the loop is finished, and then
displays 99, despite calling redraw() and update()
How can I fix this?
myCanvas extends Canvas, Image image, Text yearNumber
for (int i = 0; i <= 99; i++)
{
doNumberCrunching(); //calculations will cause image to change
myCanvas.resetImageData(); // this changes pixel values
image = new Image(display, imageData);
myCanvas.redraw(); // put a redraw event on the OS event queue
myCanvas.update(); // force redraw
// update the year displayed
yearNumber.setText(new Integer(i).toString());
yearNumber.redraw();
yearNumber.update();
} // end for