本文整理匯總了Python中pyface.gui.GUI.invoke_after方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.invoke_after方法的具體用法?Python GUI.invoke_after怎麽用?Python GUI.invoke_after使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyface.gui.GUI
的用法示例。
在下文中一共展示了GUI.invoke_after方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _wait_for_data
# 需要導入模塊: from pyface.gui import GUI [as 別名]
# 或者: from pyface.gui.GUI import invoke_after [as 別名]
def _wait_for_data(self):
next_poll = self._handle_data()
socks = dict(self._poller.poll(timeout=self.poll_timeout))
if self._handshake_socket in socks and \
socks[self._handshake_socket] == zmq.POLLIN:
self._handle_connection()
GUI.invoke_after(next_poll, self._wait_for_data)
示例2: _play_func
# 需要導入模塊: from pyface.gui import GUI [as 別名]
# 或者: from pyface.gui.GUI import invoke_after [as 別名]
def _play_func(self):
'''
Called while play button is selected
:return:
'''
if self._play_thread:
if self._last_clicked_direction is not None:
self._last_clicked_direction()
else:
self.move_forward()
GUI.invoke_after(1000, self._play_func)
示例3: _play_button_changed
# 需要導入模塊: from pyface.gui import GUI [as 別名]
# 或者: from pyface.gui.GUI import invoke_after [as 別名]
def _play_button_changed(self, play_pressed):
'''
Triggered when play button is selected
:param play_pressed:
:return:
'''
if play_pressed:
if not self._play_thread:
self._play_thread = True
GUI.invoke_after(1, self._play_func)
else:
self._play_thread = False
示例4: start
# 需要導入模塊: from pyface.gui import GUI [as 別名]
# 或者: from pyface.gui.GUI import invoke_after [as 別名]
def start(self):
self._zmq_context = zmq.Context()
self._poller = zmq.Poller()
self._handshake_socket = self._zmq_context.socket(zmq.REP)
self._handshake_socket.bind(self.handshake_string)
self._data_socket = self._zmq_context.socket(zmq.SUB)
self._data_socket.setsockopt(zmq.SUBSCRIBE, '')
self._data_socket.connect(self.data_string)
self._poller.register(self._handshake_socket, zmq.POLLIN)
self._poller.register(self._data_socket, zmq.POLLIN)
GUI.invoke_after(self.poll_period, self._wait_for_data)