python-traitsui。在触发按钮完成之前更新属性

时间:2018-11-09 17:59:49

标签: python user-interface enthought traitsui

我正在尝试在按钮触发操作结束之前更新属性和GUI。 我觉得这应该很简单,但是我错过了File "C:\Users\constantinos\AppData\Local\Programs\Python\Python37-32\lib\site-packages\graphviz\files.py", line 188, in render rendered = backend.render(self._engine, format, filepath, renderer, formatter) File "C:\Users\constantinos\AppData\Local\Programs\Python\Python37-32\lib\site-packages\graphviz\backend.py", line 183, in render run(cmd, capture_output=True, check=True, quiet=quiet) File "C:\Users\constantinos\AppData\Local\Programs\Python\Python37-32\lib\site-packages\graphviz\backend.py", line 150, in run raise ExecutableNotFound(cmd) graphviz.backend.ExecutableNotFound: failed to execute ['dot', '-Tpdf', '-O', 'iris'], make sure the Graphviz executables are on your systems' PATH 命令或其他内容。

部分代码如下:

update

按下按钮时,item1 = Property(Str, depends_on = ['button1']) button1 = Button('Perform Action') myview = View(Item('button1'), Item('item1')) def _get_item1(self): return somefunction() def _button1_fired(self): dosomething1() dosomething2() 将更改dosomething1()的输出。 somefunction()会将dosomething2()的输出更改为其他内容。但是,运行此命令时,GUI将仅在somefunction()完成后更新item1

是否可以在两个_button1_fired函数之间插入方法或命令,以使GUI“实时”更新

0 个答案:

没有答案