[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] AsyncExec() problem ?

yes this is exactly the pb :
the runnable has always the focus. and it never share it with the GUI.
so that when I use a loop-runnable to update the GUI, I lose totally the
focus of the GUI.

--
Sylvain Becker

-----Original Message-----
From: platform-swt-dev-admin@xxxxxxxxxxx
[mailto:platform-swt-dev-admin@xxxxxxxxxxx]On Behalf Of Michael R Head
Sent: Thursday, October 30, 2003 7:19 PM
To: SWT List
Subject: Re: [platform-swt-dev] AsyncExec() problem ?


On Thu, 2003-10-30 at 18:28, Sylvain Becker wrote:
>
> //set a thread to update the gui.
> display.asyncExec( new Runnable() {
> 		public void run() {
> 			while(true) {
>   				System.out.println("aa");
> 				//here, stuff to update the gui.
> 			}
> 		}
> });

If I understand things correctly, this Runnable will hijack the GUI
thread. That would be why the GUI wouldn't respond. I'm not sure what
that has to do with the processing of this thread.

If you had:

//set a thread to update the gui.
display.asyncExec( new Runnable() {
                public void run() {
                        while(true) {
                                System.out.println("aa");
                                //here, stuff to update the gui.
                        }
                }
});
while(true) {
	System.out.println("bb");
}

I would expect to see both "aa" and "bb" on the console, but the GUI
would never refresh. Is that what you get when you run it?

Apologies if I didn't understand your question correctly, I'm just
responding to the code presented.

mike

> thanks you for your help,
>
>
> --
> Sylvain Becker
--
Michael R Head <burner@xxxxxxxxxxx>
ZClipse -- OpenSource Eclipse plugins

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev