[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Text - wait for input

That was it - thanks!

"Grant Gayed" <grant_gayed@xxxxxxxxxx> schrieb im Newsbeitrag 
news:ekk9hq$md8$1@xxxxxxxxxxxxxxxxxxxx
> Hi Michael,
>
> Assuming I understand correctly...
>
> Display.asyncExec(arg) does not create a new thread, it just ensures that
> the contents of arg get executed in the UI thread, which is necessary for
> accessing SWT widgets.  So if you want to do work in a background thread 
> you
> still need to create the Thread and run it, but whenever it wants to 
> access
> an swt widget it needs to do so within the Runnable that's given to either
> Display.syncExec(...) or Display.asyncExec(...).
>
> As an alternative, if you just want to run something after one second, you
> can use Display.timerExec(...) instead.
>
> If I misunderstood your question then please follow up here, thanks.
>
> Grant
>
>
> "Michael Sachs" <msa@xxxxxxxxxxx> wrote in message
> news:ekk26m$518$1@xxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I do some operation on any keyevent in a textfield (filtering). To start
> the
>> operation not to often I thougth about waiting 1 second if another
> keystroke
>> is done.
>> First I tried with a Thread, but I had no access rights to the text
> widget.
>> So the docu said to solve that with:
>> shell.getDisplay().asyncExec(new Runnable() {
>>
>> public void run() {
>>
>> ...}
>>
>> But thats not a Thread and I cant wait for a second?!
>>
>> Regards
>>
>> Michael
>>
>>
>
>