def func(): with _self.lockcm: if swap_buffers: r = _cmd.refresh_now(_self._COb) else: r = _cmd.refresh(_self._COb) return r
def _refresh(swap_buffers=1, _self=cmd): # Only call with GLUT thread! # WARNING: internal routine, subject to change r = None try: _self.lock(_self) if _self.is_gui_thread(): if swap_buffers: r = _cmd.refresh_now(_self._COb) else: r = _cmd.refresh(_self._COb) else: r = _cmd.refresh_later(_self._COb) finally: _self.unlock(-1, _self) return r
def _refresh(swap_buffers=1,_self=cmd): # Only call with GLUT thread! # WARNING: internal routine, subject to change r = None try: _self.lock(_self) if hasattr(_self._pymol,'glutThread'): if thread.get_ident() == _self._pymol.glutThread: if swap_buffers: r = _cmd.refresh_now(_self._COb) else: r = _cmd.refresh(_self._COb) else: r = _cmd.refresh_later(_self._COb) else: r = _cmd.refresh_later(_self._COb) finally: _self.unlock(-1,_self) return r