def dispatch(method):
    """
    Decorator for making Tkinter methods multithread safe.
    This is needed whenever an outside thread executes Tkinter commands.
    
    It works by postponing execution until ready.
    """
    
    def wrapper(self, *args, **kw):
        self.after_idle(method, self, *args, **kw)
    
    return wrapper