'Schedule function to run in main wx/Twisted thread.
Called by the select() thread.'

def _runInMainThread(self, f):

    if hasattr(self, 'wxapp'):
        wxCallAfter(f)
    else:
        self._postQueue.put(f)
