[ENH] NewProgressBar (reviewed [er][et])
Yoshiki Ohshima
Yoshiki.Ohshima at acm.org
Wed Apr 7 20:03:33 UTC 2004
Hello,
I tested this. The 'at: aPoint' argument seems to be ignored, but
I think it is ok.
The nested usage something like:
------------------------------
['Now you see it... '
displayProgressAt: Display center
from: 0 to: 100
during: [:bar |
1 to: 100 do: [:i |
bar value: i.
'i=', i printString displayProgressAt: Sensor cursorPoint
from: 1 to: 1e5 during: [:baz |
1 to: 1e5 do: [:j |
baz value: j
]
]
]]] timeToRun
------------------------------
or even,
------------------------------
['Now you see it... '
displayProgressAt: Display center
from: 0 to: 1e2
during: [:bar |
1 to: 1e2 do: [:i |
bar value: i.
'i=', i printString displayProgressAt: Sensor cursorPoint
from: 1 to: 1e2 during: [:baz |
1 to: 1e2 do: [:j |
baz value: j
'j = ', j printString dissplayPregressAt: Sensor cursorPoint
from 1 to: 1e2 during: [:foo |
foo value: k.
]
]
]
]]] timeToRun
------------------------------
works. (To see the 'k' loop, insert some delay there)
The performance penalty, compared to the 'direct to Display'
version, is some 25%. Which I think quite reasonable.
So, I'd say this is good to be included.
-- Yoshiki
More information about the Squeak-dev
mailing list
|