<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 9:54 AM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If, by &quot;the progress bar&quot; you mean SystemProgressMorph, I disagree,<br>
since that would create a dependency on Morphic.<br>
ProgressInitiationException allows domain-level code to signal that<br>
something worth indicating progress is occurring, and different UI<br>
frameworks can capture that notification (or not) and render it each<br>
in their own way.<br></blockquote><div><br></div><div>This sounds even worse.  Are you implying that you&#39;re going to pepper the system with &quot;ProgressInitiationException signal&quot;s just in case there&#39;s a progress morph waiting to update?  That&#39;s absurd, a) on performance grounds, an unhandled exception is an expensive thing (an entire stack walk to discover there&#39;s no handler), b) on neatness/complexity grounds, littering the system with dependencies, yuck.  The Exceptions package is for the exceptions machinery and core exceptions, /not/ for every conceivable exception, notification or warning imaginable.  I haven&#39;t been keeping up, so could you outline the usage model here and give some examples?  I think there needs to be very careful thought on the interface between domain code and progress; a) where separation can&#39;t be obtained something analogous to MVC where changed messages are cheap if a Model has no dependents, b) where separation can be obtained (the traditional showProgessWhile: aBlock form) the progress additions are nicely encapsulated within the showProgressWhile: form.</div>
<div><br></div><div>best</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
 - Chris<br>
<br>
<br>
On Wed, Jun 15, 2011 at 11:48 AM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt; Hi Chris,<br>
&gt;     just because ProgressInitiationException is an exception doesn&#39;t imply<br>
&gt; it belongs in exceptions.  Surely it belongs in the same package as the<br>
&gt; progress bar.<br>
&gt; best<br>
&gt; Eliot<br>
&gt;<br>
&gt; On Wed, Jun 15, 2011 at 9:13 AM, &lt;<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Chris Muller uploaded a new version of Exceptions to project The Trunk:<br>
&gt;&gt; <a href="http://source.squeak.org/trunk/Exceptions-cmm.34.mcz" target="_blank">http://source.squeak.org/trunk/Exceptions-cmm.34.mcz</a><br>
&gt;&gt;<br>
&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;<br>
&gt;&gt; Name: Exceptions-cmm.34<br>
&gt;&gt; Author: cmm<br>
&gt;&gt; Time: 15 June 2011, 11:13:51.392 am<br>
&gt;&gt; UUID: f0144460-f227-7b43-bee2-019786f35a4e<br>
&gt;&gt; Ancestors: Exceptions-nice.33<br>
&gt;&gt;<br>
&gt;&gt; First step toward preferredProgressBarPosition preference.<br>
&gt;&gt;<br>
&gt;&gt; =============== Diff against Exceptions-nice.33 ===============<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;  Exception subclass: #ProgressInitiationException<br>
&gt;&gt;        instanceVariableNames: &#39;workBlock maxVal minVal aPoint<br>
&gt;&gt; progressTitle&#39;<br>
&gt;&gt; +       classVariableNames: &#39;PreferredProgressBarPosition&#39;<br>
&gt;&gt; -       classVariableNames: &#39;&#39;<br>
&gt;&gt;        poolDictionaries: &#39;&#39;<br>
&gt;&gt;        category: &#39;Exceptions-Kernel&#39;!<br>
&gt;&gt;<br>
&gt;&gt;  !ProgressInitiationException commentStamp: &#39;&lt;historical&gt;&#39; prior: 0!<br>
&gt;&gt;  I provide a way to alter the behavior of the old-style progress notifier<br>
&gt;&gt; in String. See examples in:<br>
&gt;&gt;<br>
&gt;&gt;  ProgressInitiationException testWithout.<br>
&gt;&gt;  ProgressInitiationException testWith.<br>
&gt;&gt;  !<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;  ----- Method: ProgressInitiationException<br>
&gt;&gt; class&gt;&gt;display:at:from:to:during: (in category &#39;signalling&#39;) -----<br>
&gt;&gt; + display: aString at: aPoint from: minVal to: maxVal during: workBlock<br>
&gt;&gt; - display: aString at: aPoint from: minVal to: maxVal during: workBlock<br>
&gt;&gt; -<br>
&gt;&gt;        ^ self new<br>
&gt;&gt; +               display: aString<br>
&gt;&gt; +               at: (aPoint ifNil: [ self preferredProgressBarPoint ])<br>
&gt;&gt; +               from: minVal<br>
&gt;&gt; +               to: maxVal<br>
&gt;&gt; +               during: workBlock!<br>
&gt;&gt; -               display: aString at: aPoint from: minVal to: maxVal<br>
&gt;&gt; during: workBlock!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: ProgressInitiationException class&gt;&gt;display:from:to:during:<br>
&gt;&gt; (in category &#39;signalling&#39;) -----<br>
&gt;&gt; + display: aString from: minVal to: maxVal during: workBlock<br>
&gt;&gt; +       ^ self<br>
&gt;&gt; +               display: aString<br>
&gt;&gt; +               at: nil<br>
&gt;&gt; +               from: minVal<br>
&gt;&gt; +               to: maxVal<br>
&gt;&gt; +               during: workBlock!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; class&gt;&gt;preferredProgressBarPoint (in category &#39;accessing&#39;) -----<br>
&gt;&gt; + preferredProgressBarPoint<br>
&gt;&gt; +       ^ self preferredProgressBarPosition = #cursorPoint<br>
&gt;&gt; +               ifTrue: [ Sensor cursorPoint ]<br>
&gt;&gt; +               ifFalse: [ UIManager default screen perform: self<br>
&gt;&gt; preferredProgressBarPosition ]!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; class&gt;&gt;preferredProgressBarPosition (in category &#39;accessing&#39;) -----<br>
&gt;&gt; + preferredProgressBarPosition<br>
&gt;&gt; +       ^ PreferredProgressBarPosition ifNil: [ #center ]!<br>
&gt;&gt;<br>
&gt;&gt; Item was added:<br>
&gt;&gt; + ----- Method: ProgressInitiationException<br>
&gt;&gt; class&gt;&gt;preferredProgressBarPosition: (in category &#39;accessing&#39;) -----<br>
&gt;&gt; + preferredProgressBarPosition: aSymbol<br>
&gt;&gt; +       &quot;Specify any of:  #center, #topCenter, #bottomCenter, #leftCenter,<br>
&gt;&gt; #rightCenter, #topLeft, #topRight, #bottomLeft or #bottomRight or<br>
&gt;&gt; #cursorPoint.&quot;<br>
&gt;&gt; +       ^ PreferredProgressBarPosition!<br>
&gt;&gt;<br>
&gt;&gt; Item was changed:<br>
&gt;&gt;  ----- Method: ProgressInitiationException class&gt;&gt;testInnermost (in<br>
&gt;&gt; category &#39;examples and tests&#39;) -----<br>
&gt;&gt;  testInnermost<br>
&gt;&gt;<br>
&gt;&gt;        &quot;test the progress code WITHOUT special handling&quot;<br>
&gt;&gt;<br>
&gt;&gt;        ^&#39;Now here&#39;&#39;s some Real Progress&#39;<br>
&gt;&gt; +               displayProgressFrom: 0<br>
&gt;&gt; -               displayProgressAt: Sensor cursorPoint<br>
&gt;&gt; -               from: 0<br>
&gt;&gt;                to: 10<br>
&gt;&gt;                during: [ :bar |<br>
&gt;&gt;                        1 to: 10 do: [ :x |<br>
&gt;&gt;                                bar value: x. (Delay forMilliseconds: 500)<br>
&gt;&gt; wait.<br>
&gt;&gt;                                x = 5 ifTrue: [1/0].    &quot;just to make life<br>
&gt;&gt; interesting&quot;<br>
&gt;&gt;                        ].<br>
&gt;&gt;                        &#39;done&#39;<br>
&gt;&gt;                ].<br>
&gt;&gt;<br>
&gt;&gt;  !<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br>