How can I show a progress bar in Pharo?
up vote
1
down vote
favorite
I have a do:
in Pharo that takes a long time to process. I'd like to show the progress of it to the user. How is that done in Pharo?
pharo
add a comment |
up vote
1
down vote
favorite
I have a do:
in Pharo that takes a long time to process. I'd like to show the progress of it to the user. How is that done in Pharo?
pharo
Dear down voter who left no comment: how is this question worse than stackoverflow.com/questions/3951903 or stackoverflow.com/q/238073/1168342 or stackoverflow.com/q/3160699/1168342
– Fuhrmanator
Nov 19 at 15:31
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a do:
in Pharo that takes a long time to process. I'd like to show the progress of it to the user. How is that done in Pharo?
pharo
I have a do:
in Pharo that takes a long time to process. I'd like to show the progress of it to the user. How is that done in Pharo?
pharo
pharo
edited Nov 19 at 15:32
asked Nov 19 at 13:23
Fuhrmanator
4,96833166
4,96833166
Dear down voter who left no comment: how is this question worse than stackoverflow.com/questions/3951903 or stackoverflow.com/q/238073/1168342 or stackoverflow.com/q/3160699/1168342
– Fuhrmanator
Nov 19 at 15:31
add a comment |
Dear down voter who left no comment: how is this question worse than stackoverflow.com/questions/3951903 or stackoverflow.com/q/238073/1168342 or stackoverflow.com/q/3160699/1168342
– Fuhrmanator
Nov 19 at 15:31
Dear down voter who left no comment: how is this question worse than stackoverflow.com/questions/3951903 or stackoverflow.com/q/238073/1168342 or stackoverflow.com/q/3160699/1168342
– Fuhrmanator
Nov 19 at 15:31
Dear down voter who left no comment: how is this question worse than stackoverflow.com/questions/3951903 or stackoverflow.com/q/238073/1168342 or stackoverflow.com/q/3160699/1168342
– Fuhrmanator
Nov 19 at 15:31
add a comment |
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
Here are two ways:
Collection
borrows fromUIManager
and supports adisplayingProgress:
every: milliseconds
variant ofdo:
:
(1 to: 60)
do: [ :e | (Delay forSeconds: 0.5) wait "simulate a delay" ]
displayingProgress: [ :e | 'waiting ' , e asString ] every: 1000
You can play with the
every:
on this example to see that if you set it to less than 1000ms, it will update more often (setting it to 100 will show you every value of the interval).
Also, you can simply use
displayingProgress: 'Waiting...'
to only show the same string the whole time, without a block.
Using the
Job
class. Here's a similar solution as above:
myColl := 1 to: 20.
[ :job |
myColl
do: [ :e |
job
progress: e / myColl size;
title: 'waiting ' , e asString.
(Delay forSeconds: 0.5) wait ] ] asJob run
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
Here are two ways:
Collection
borrows fromUIManager
and supports adisplayingProgress:
every: milliseconds
variant ofdo:
:
(1 to: 60)
do: [ :e | (Delay forSeconds: 0.5) wait "simulate a delay" ]
displayingProgress: [ :e | 'waiting ' , e asString ] every: 1000
You can play with the
every:
on this example to see that if you set it to less than 1000ms, it will update more often (setting it to 100 will show you every value of the interval).
Also, you can simply use
displayingProgress: 'Waiting...'
to only show the same string the whole time, without a block.
Using the
Job
class. Here's a similar solution as above:
myColl := 1 to: 20.
[ :job |
myColl
do: [ :e |
job
progress: e / myColl size;
title: 'waiting ' , e asString.
(Delay forSeconds: 0.5) wait ] ] asJob run
add a comment |
up vote
5
down vote
accepted
Here are two ways:
Collection
borrows fromUIManager
and supports adisplayingProgress:
every: milliseconds
variant ofdo:
:
(1 to: 60)
do: [ :e | (Delay forSeconds: 0.5) wait "simulate a delay" ]
displayingProgress: [ :e | 'waiting ' , e asString ] every: 1000
You can play with the
every:
on this example to see that if you set it to less than 1000ms, it will update more often (setting it to 100 will show you every value of the interval).
Also, you can simply use
displayingProgress: 'Waiting...'
to only show the same string the whole time, without a block.
Using the
Job
class. Here's a similar solution as above:
myColl := 1 to: 20.
[ :job |
myColl
do: [ :e |
job
progress: e / myColl size;
title: 'waiting ' , e asString.
(Delay forSeconds: 0.5) wait ] ] asJob run
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
Here are two ways:
Collection
borrows fromUIManager
and supports adisplayingProgress:
every: milliseconds
variant ofdo:
:
(1 to: 60)
do: [ :e | (Delay forSeconds: 0.5) wait "simulate a delay" ]
displayingProgress: [ :e | 'waiting ' , e asString ] every: 1000
You can play with the
every:
on this example to see that if you set it to less than 1000ms, it will update more often (setting it to 100 will show you every value of the interval).
Also, you can simply use
displayingProgress: 'Waiting...'
to only show the same string the whole time, without a block.
Using the
Job
class. Here's a similar solution as above:
myColl := 1 to: 20.
[ :job |
myColl
do: [ :e |
job
progress: e / myColl size;
title: 'waiting ' , e asString.
(Delay forSeconds: 0.5) wait ] ] asJob run
Here are two ways:
Collection
borrows fromUIManager
and supports adisplayingProgress:
every: milliseconds
variant ofdo:
:
(1 to: 60)
do: [ :e | (Delay forSeconds: 0.5) wait "simulate a delay" ]
displayingProgress: [ :e | 'waiting ' , e asString ] every: 1000
You can play with the
every:
on this example to see that if you set it to less than 1000ms, it will update more often (setting it to 100 will show you every value of the interval).
Also, you can simply use
displayingProgress: 'Waiting...'
to only show the same string the whole time, without a block.
Using the
Job
class. Here's a similar solution as above:
myColl := 1 to: 20.
[ :job |
myColl
do: [ :e |
job
progress: e / myColl size;
title: 'waiting ' , e asString.
(Delay forSeconds: 0.5) wait ] ] asJob run
answered Nov 19 at 13:23
Fuhrmanator
4,96833166
4,96833166
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375593%2fhow-can-i-show-a-progress-bar-in-pharo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Dear down voter who left no comment: how is this question worse than stackoverflow.com/questions/3951903 or stackoverflow.com/q/238073/1168342 or stackoverflow.com/q/3160699/1168342
– Fuhrmanator
Nov 19 at 15:31