本文整理汇总了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)