code: def gui_call(self, method, *args, **kwdargs):
          
          my_id = thread.get_ident()
          if my_id == self.gui_thread_id:
              return method(*args, **kwdargs)
          else:
              future = self.gui_do(method, *args, **kwdargs)
              return future.wait()
docs: General method for synchronously calling into the GUI.
          This waits until the method has completed before returning.