| [platform-swt-dev] Composite children composites repaint issue |
|
Hi
guys : Good
day ! I
have met a problem when developing UI with SWT, I created a Composite and add
Composites
to it as children ,each child Composite has an image as
data,my
logic to control the repaint is like this : parentComposite.addPaintListener(new
PaintListener(){ I created other composites
with parentComposite as parent,I added paintListener to child Composite like
this Composite
composite = new
Composite(parentComposite,SWT.BORDER);
File imageFile = (File)imageButton.getData();
composite.setData(new
Image(display,imageFile.getAbsolutePath()));
composite.addPaintListener(new
PaintListener(){
public
void
paintControl(PaintEvent e) {
if(composite.getData()
!= null){
Image image = (Image)composite.getData();
GC gc = e.gc;
gc.drawImage(image, 0, 0);
}
}
}); but
the children’s paintControl method never gets called , I do not know why
, can
anybody give me any clue ? Best regards
! Liang
chen |