更新mathematica中的进度条
在计算过程中,我会更新进度条的值以通知用户计算的进度。
不幸的是,我无法执行此操作,因为当我调用 SetPropertyValue 函数时,
ref@SetPropertyValue[{"bar", "value"}, 70];
该值不会更新。
我以这种方式获得参考
ref = GUIRun[mainWindow];
during the computation I would update the value of progress bar to notify to the user the progress of the computation.
Unfortunately I'm not able to do this because when I call SetPropertyValue function
ref@SetPropertyValue[{"bar", "value"}, 70];
the value isn't updated.
I obtain ref in this way
ref = GUIRun[mainWindow];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 Mathematica 6 或更高版本,请尝试使用 Monitor 和 ProgressIndicator 而不是旧的 GUIKit 包:
With Mathematica 6 or later try using Monitor and ProgressIndicator instead of the older GUIKit package:
这只是@ragfield 答案的扩展。
如果你想表示有界和无界的大小,你可以按照以下方式做一些事情:
如果你想将进度指示器保存为动画 gif 用于演示等,你可以对其进行一些修改:
结果是:
This is just an extension to @ragfield's answer.
If you want to represent bounded and unbounded magnitudes, you colud do something along these lines:
If you want to save the progress indicators as an animated gif for presententations and the such, you could modify it a bit:
and the result is:
执行
您是否记得在开始使用 GUIKit 之前 ?如果不是,您的命令将不会执行,因为它们是未知的。如果您在开始使用 GUIKit 后加载它,请不要忘记它的某些符号可能会被您无意中定义的符号所遮蔽。
Did you remember to execute
before starting to use the GUIKit ? If not your commands won't execute, because they are not known. If you load the GUIKit after you start using it, don't forget that some of its symbols may be shadowed by the symbols you have inadvertently defined.