GUI: make code EDT-safe.