I ran into a problem when using streaming for the first time. In the SWT program in the main thread, I created a graphical interface and opened a shell, and then I started to launch a new thread to start some logic in the model and in the model in a certain state there is a method that is called in the GUI class ... and here the problem is called in second thread, while I want it to be called in the main thread, or at least execute it in the main thread
How can I solve this problem? Thank,
External threads cannot access the graphical interface. Check it out display.asyncExec.
display.asyncExec
asyncExec syncExec Display, runnable :
asyncExec
syncExec
Display
// do stuff in a background thread // ...then schedule job to run in main thread display.asyncExec(new Runnable() { ... });
syncExec asyncExec (UI) . , asyncExec , syncExec , .
Source: https://habr.com/ru/post/1735344/More articles:What is the difference between "Local Linker Symbols" and "Local Program Variables"? - symbolsFileStream and Encoding - c #Blackberry menu from BlackBerry app - eventsC #: Direct3D in the control, and full-screen mode on the secondary monitor - what's the best way? - c #Doing Math.Round (x, 2) at a decimal value, but you need to provide 2 numbers after the decimal as money - decimalSpring-Security 3 / Spring MVC and the scary @ Secured / RequestMapping - javaHow to store and retrieve exception.ToString () values in a csv file in .NET framework? - .netSelective Javadocs API - javaПроблемы с потоковым потоком iPhone с конкатенированными видеофайлами - iphoneAndroid: метод остановки будет вызываться дважды, если он уже запущен - androidAll Articles