| [news.eclipse.platform.swt] Re: how to update the shell after invoke setSize()?? |
can anyone give a help ?
hello : the snippet as show below:
Display display = new Display();
final Shell shell = new Shell(display);
shell.setSize(200,200);
display.asyncExec(new Runnable() {
public void run() {
while(true) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Point size = shell.getSize();
shell.setSize(size.x+=50,size.y+=50);
}
}
});
shell.open();
while(!shell.isDisposed())
display.readAndDispatch();
display.dispose();
In the same UI_Thread,for example a button ,if it invokes the setSize()
function of the shell ,the shell will change its size immediately .
But the shell won't change its size when another thread invokes its setSize() function !
and another question : how to detect whether the shell is in focus ?
Thank you for your help !
Steve Northover wrote:
I don't understand the question. CAn you provide a small stand alone snippet?
"bbskill" <bbkills@xxxxxxx> wrote in message news:d4ibai$kse$1@xxxxxxxxxxxxxxxxxxx
hello all, that is my question: when I change the size of shell with the setSize() after it is opened, how can I update the size of the shell immediately ?? Thanks for your help!!