Building a GUI interface is usually done in the same process running the Cuis-Smalltalk system user interface – the Morphic process. In some special circumstance, you may need to build part of an user interface in a separated thread, ran in parallel to the system user interface process. The main reason to do so is when intensive computations are involved and you do not want to lock temporally the whole user interface.
But the fact that GUI building runs in another thread may lead to strange behavior and results not always the same. Your code may sometimes be scheduled to run before the layout is done in the Morphic process, and sometimes it is scheduled to run after it.
Generally speaking, the safe way to do Morphic stuff from non-morphic process is to encapsulate your Morphic part in UISupervisor whenUIinSafeState: []. Otherwise the Morphic state may be inconsistent when your process access it. Many kinds of problems could arise.
noteNewOwner: morphB
UISupervisor whenUIinSafeState: [
self morphPosition: morphB morphExtent - self morphExtent // 2 ]