MeVisLab Toolbox Reference
|
Calling specific methods from a background thread is not allowed for methods that interact with UI elements or implictly invoke field listeners. The solution is to schedule the method invocation with an event to the main thread. This helper utility should make this a no-brainer and protects from the usual foot gun scenario regarding module destruction with unprocessed events.
The safest way of using it if you don't have control over the thread object is to grab a protected handle from MainThreadCommunicator that can be used to access the call functionality. This way, the module's destructor will wait until the access scope is over.
Synopsis:
A simpler way, which can only (!) be used if the module instance itself has control over the thread object, is noted down here: