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