Threading problem between swing/swt [message #440122] |
Fri, 23 July 2004 11:27 |
Eclipse User |
|
|
|
Originally posted by: sunay.yaldiz.gentleware.com
Hello,
I have a strange problem on threading, at least I guess it is because of
threading. In an Eclipse action, I am calling a method which shows (for
saving of a project)swing gui for asking "are you sure to overwrite "
etc and a progress bar for showing the status of saving. After showing
the window, it does not let the interaction with the window. I can not
answer as "yes" or "no" for example.
I tried to put the method call which shows swing gui in
display.asynchExec thinking it could help, but no help.
Display.asyncExec (new Runnable () {
public void run () { //this method shows swing gui and
progressdialog
myProject.save(filepath);
}
});
By the way, the save method also uses threads itself.(not sure if it is
related..)
What can I do, I am struggling with it since yesterday, but could not
find any solution.
Any help is appreciated,
Thanks
Sunay
|
|
|
Re: Threading problem between swing/swt [message #440123 is a reply to message #440122] |
Fri, 23 July 2004 12:48 |
David Thomson Messages: 65 Registered: July 2009 |
Member |
|
|
Did you try putting it in a separate thread and running it *without*
Display.syncExec/Display.asyncExec? I have never tried running a Swing
GUI from SWT, but I have tried the other way around, and I always have
to put it in a separate thread or otherwise it will block the Swing
event thread from continuing. If you try that and it doesn't work, I'll
experiment myself and try to help.
David
Sunay Yaldiz wrote:
>
> Hello,
>
> I have a strange problem on threading, at least I guess it is because of
> threading. In an Eclipse action, I am calling a method which shows (for
> saving of a project)swing gui for asking "are you sure to overwrite "
> etc and a progress bar for showing the status of saving. After showing
> the window, it does not let the interaction with the window. I can not
> answer as "yes" or "no" for example.
>
> I tried to put the method call which shows swing gui in
> display.asynchExec thinking it could help, but no help.
>
> Display.asyncExec (new Runnable () {
> public void run () { //this
> method shows swing gui and progressdialog
> myProject.save(filepath);
> }
> });
>
> By the way, the save method also uses threads itself.(not sure if it is
> related..)
>
> What can I do, I am struggling with it since yesterday, but could not
> find any solution.
>
> Any help is appreciated,
> Thanks
> Sunay
|
|
|
Re: Threading problem between swing/swt [message #440124 is a reply to message #440123] |
Fri, 23 July 2004 14:59 |
Eclipse User |
|
|
|
Originally posted by: sunay.yaldiz.gentleware.com
Your suggestion worked. Thank you very much.
Best regards,
Sunay
David Thomson wrote:
> Did you try putting it in a separate thread and running it *without*
> Display.syncExec/Display.asyncExec? I have never tried running a Swing
> GUI from SWT, but I have tried the other way around, and I always have
> to put it in a separate thread or otherwise it will block the Swing
> event thread from continuing. If you try that and it doesn't work, I'll
> experiment myself and try to help.
>
> David
>
> Sunay Yaldiz wrote:
>
>>
>> Hello,
>>
>> I have a strange problem on threading, at least I guess it is because
>> of threading. In an Eclipse action, I am calling a method which shows
>> (for saving of a project)swing gui for asking "are you sure to
>> overwrite " etc and a progress bar for showing the status of saving.
>> After showing the window, it does not let the interaction with the
>> window. I can not answer as "yes" or "no" for example.
>>
>> I tried to put the method call which shows swing gui in
>> display.asynchExec thinking it could help, but no help.
>>
>> Display.asyncExec (new Runnable () {
>> public void run () { //this
>> method shows swing gui and progressdialog
>> myProject.save(filepath); }
>> });
>>
>> By the way, the save method also uses threads itself.(not sure if it
>> is related..)
>>
>> What can I do, I am struggling with it since yesterday, but could not
>> find any solution.
>>
>> Any help is appreciated,
>> Thanks
>> Sunay
|
|
|
Powered by
FUDForum. Page generated in 0.02146 seconds