本文整理汇总了Python中pyface.api.GUI.invoke_after方法的典型用法代码示例。如果您正苦于以下问题:Python GUI.invoke_after方法的具体用法?Python GUI.invoke_after怎么用?Python GUI.invoke_after使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyface.api.GUI
的用法示例。
在下文中一共展示了GUI.invoke_after方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def process(self):
for job in self.jobs:
job.percent_complete = min(
job.percent_complete + random.randint(0, 3), 100)
if any(job.percent_complete < 100 for job in self.jobs):
GUI.invoke_after(100, self.process)
示例2: close
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def close():
"""Close the scene."""
f = mlab.gcf()
e = mlab.get_engine()
e.window.workbench.prompt_on_exit = False
e.window.close()
mlab.options.backend = 'auto'
# Hack: on Linux the splash screen does not go away so we force it.
GUI.invoke_after(500, e.window.workbench.application.gui.stop_event_loop)
示例3: close
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def close(self):
""" Close the dialog. """
self._closing = True
# We don't call our superclass' 'close' method immediately as there
# may be one final call to '_pulse_and_reschedule' already on the
# event queue. This makes sure that we call 'close' *after* that final
# update.
GUI.invoke_after(self.delay, super(PulseProgressDialog, self).close)
示例4: main
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def main():
""" Entry point for standalone testing/debugging. """
from pyface.api import GUI
gui = GUI()
progress_dialog = PulseProgressDialog(title="Test", message="Doing something possibly interesting...")
progress_dialog.open()
gui.invoke_after(3000, progress_dialog.close)
gui.start_event_loop()
return
示例5: _anytrait_changed
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def _anytrait_changed ( self, name, old, new ):
if name[:4] == 'var_':
name = name[4:]
if (not self._no_block_update) and (self.block is not None):
if isinstance( old, ArangeGenerator ):
old.on_trait_change( self._array_changed, 'array',
remove = True )
if isinstance( new, ArangeGenerator ):
new.on_trait_change( self._array_changed, 'array' )
new = new.array
self.context[ name ] = new
self._needs_update = True
#print "Adding update func"
def update_func():
if self._needs_update:
self._blocks[ name ].execute( self.context )
self._needs_update = False
GUI.invoke_after(10, update_func)
示例6: close
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def close(self):
""" Close progress bar window. """
GUI.invoke_after(0.1, super(PulsableProgressDialog, self).close)
sleep(0.2)
示例7: f
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def f():
do_mlab()
# Automatically close window in 2500 msecs.
GUI.invoke_after(2500, close)
示例8: test_mlab_show
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def test_mlab_show():
"""Test mlab.show()"""
do_mlab()
# Automatically close window in 2500 msecs.
GUI.invoke_after(2500, close)
mlab.show()
示例9: _schedule_pulse
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def _schedule_pulse(self):
""" Schedule a pulse for 'self.delay' milliseconds from now. """
GUI.invoke_after(self.delay, self._pulse_and_reschedule)
示例10: f
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def f():
run_mlab_examples()
# Automatically close window in 100 msecs.
GUI.invoke_after(100, close)
示例11: test_mlab_show
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def test_mlab_show():
"""Test mlab.show()"""
run_mlab_examples()
# Automatically close window in 100 msecs.
GUI.invoke_after(100, close)
mlab.show()
示例12: f
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def f():
from mayavi.preferences.api import preference_manager
preference_manager.root.show_splash_screen = False
mlab.options.backend = 'envisage'
mlab.test_contour3d()
GUI.invoke_after(3000, close)
示例13: _start_fired
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def _start_fired(self):
self.populate()
GUI.invoke_after(1000, self.process)
示例14: f
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def f():
mlab.options.backend = 'envisage'
mlab.test_contour3d()
GUI.invoke_after(3000, close)
示例15: _new_workbench_window_created
# 需要导入模块: from pyface.api import GUI [as 别名]
# 或者: from pyface.api.GUI import invoke_after [as 别名]
def _new_workbench_window_created(self, event):
try:
GUI.invoke_after(500.0, self.mcss_ui_plugin.edit_new_mcss_experiment, event.window) # do it in the UI thread, not too fast for workbench_window to have been created and hopefully slow enough (not tested on a slow computer), but not too slow for user #@UndefinedVariable
except AttributeError:
pass # give up