Re: Pharo-project Digest, Vol 29, Issue 57

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-project Digest, Vol 29, Issue 57

Ralph Boland
I posted the following earlier to the Squeak list but didn't get a responce.
Hopefully someone on the Pharo list can help me.  I need this information
so I can make some planned changes to the ProgressDisplay package I released
a while back.

-----------------------------------------------------------------------------------------------------------------

A SystemProgressMorph is used to display progress while some computation
is being done.  Furthermore the progress bars can be stacked to show progress
of component computations within a computation.
This I understand and understand most of the code.
But not All.
What I have trouble with is understanding why a ProgressInitiationException
is needed.  In particular, String>>displayProgressAt:from:to:during:
does:

ProgressInitiationException
               display: self
               at: aPoint
               from: minVal
               to: maxVal
               during: workBlock.


This method sets a few variables and then does:

       ^self signal

This signal is caught where upon a SystemProgressMorph is started or
extended with
an additional progress bar.

But I don't understand why sending a signal to a ProgressInitiationException
is needed to get the ball rolling,

Can someone please explain why things are done the way they are?


Regards,

Ralph Boland

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pharo-project Digest, Vol 29, Issue 57

Michael Roberts-2
Hi, i don't know why things are done the way they are...
Is your question how the exception mechanism works, or why it is
needed to be done with an exception? as opposed to say doing it some
other way?

The direct answer to your question is that given it is implemented in
terms of exceptions, the signal is needed to trigger the
defaultAction, or to allow someone higher up in the stack to trap it
and redirect the notification.

hth

cheers,
Mike

On Fri, Sep 10, 2010 at 4:37 AM, Ralph Boland <[hidden email]> wrote:

> I posted the following earlier to the Squeak list but didn't get a responce.
> Hopefully someone on the Pharo list can help me.  I need this information
> so I can make some planned changes to the ProgressDisplay package I released
> a while back.
>
> -----------------------------------------------------------------------------------------------------------------
>
> A SystemProgressMorph is used to display progress while some computation
> is being done.  Furthermore the progress bars can be stacked to show progress
> of component computations within a computation.
> This I understand and understand most of the code.
> But not All.
> What I have trouble with is understanding why a ProgressInitiationException
> is needed.  In particular, String>>displayProgressAt:from:to:during:
> does:
>
> ProgressInitiationException
>               display: self
>               at: aPoint
>               from: minVal
>               to: maxVal
>               during: workBlock.
>
>
> This method sets a few variables and then does:
>
>       ^self signal
>
> This signal is caught where upon a SystemProgressMorph is started or
> extended with
> an additional progress bar.
>
> But I don't understand why sending a signal to a ProgressInitiationException
> is needed to get the ball rolling,
>
> Can someone please explain why things are done the way they are?
>
>
> Regards,
>
> Ralph Boland
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project