我在 PharoLauncher 中贡献了一个进度条,以便用户使用此代码获取图像下载进度的信息
PharoLauncher>>displayProgress:during: (in category 'template action') -----
displayProgress: label during: workBlock
| nextUpdateTime |
nextUpdateTime := 0.
^UIManager default displayProgress: label
from: 0.0 to: 1.0 during:[:bar|
[workBlock value] on: HTTPProgress do:[:ex|
(ex total == nil or: [ex amount == nil]) ifFalse:[
(nextUpdateTime < Time millisecondClockValue
or:[ex total = ex amount]) ifTrue:[
bar current: ex amount asFloat / ex total asFloat.
nextUpdateTime := Time millisecondClockValue + 100.
].
].
ex resume.
]
]
所以消息是 UIManager 默认 displayProgress: from: to: during: 。现在这工作正常,但我想将变形放置在中间,以使用户更舒适地看到它,并且它可以大幅缩放,所以更容易做. 为了做到这一点,我需要找到作为进度条容器的 Morph 并整体放大。
问题是我在尝试浏览它发送给我的这条消息的层次结构时遇到了死胡同
displayProgress: titleString from: minVal to: maxVal during: workBlock
"SystemProgressMorph show: titleString from: minVal to: during: "
^ workBlock asJob
title: titleString;
min: minVal;
max: maxVal;
run.
问题是当我去 Job 类时,正如我所料,一个 Morph 无处可寻。那么我如何找到变形以及如何定位和缩放包含所有子变形的它?