Enhancement suggestion (half-baked) 
Author Message
 Enhancement suggestion (half-baked)

Hi Andy,

Some time ago, and probably for no valid reason, I shot myself in the foot a
little by using splash screens for some things that would (I think) be
better handled with progress dialogs.  Looking at what I have to fix, I'm
starting to see a pattern.  Most of the tasks in question are things that
might be best limited in time with some text descriptions to be displayed at
certain milestones.

The time-based stuff is easy to do.  My suggestion surrounds methods like
ProgressDialog class>>showModalWhile:.  Currently, they pass a value adapter
to the block; could ProgressDialog implement #value: (pass it on to the
progress bar) and then allow #showModalWhile: and friends to pass the
progress dialog itself to the block?  Then we could access the text as well
as progress value.   What do you think?

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.



Tue, 20 Apr 2004 05:40:47 GMT  
 Enhancement suggestion (half-baked)

...
Quote:
> The time-based stuff is easy to do.  My suggestion surrounds methods like
> ProgressDialog class>>showModalWhile:.  Currently, they pass a value
adapter
> to the block; could ProgressDialog implement #value: (pass it on to the
> progress bar) and then allow #showModalWhile: and friends to pass the
> progress dialog itself to the block?  Then we could access the text as
well
> as progress value.   What do you think?

...

I like your suggestion.  In fact I had to do something similar recently.  If
ProgressDialog worked as you suggest it would have been a bit easier for me.
This is the code I ended up using:
==============
 progDialog := ProgressDialog operation: [:progress |
  Cursor wait makeCurrent.
  progDialog caption: 'Loading Compounds...'.
  self  importCompounds: progress.
  progDialog caption: 'Loading Equipment...'.
  self importEquipment: progress.
  progDialog caption: 'Loading Process...'.
  newProcess := self  importProcess: progress.
  Cursor arrow makeCurrent].
 progDialog allowCancel: false.
 progDialog showModal.
==============

Chris



Tue, 20 Apr 2004 06:54:46 GMT  
 Enhancement suggestion (half-baked)
Chris,

Quote:
> I like your suggestion.  In fact I had to do something similar recently.
If
> ProgressDialog worked as you suggest it would have been a bit easier for
me.
> This is the code I ended up using:
> ==============
>  progDialog := ProgressDialog operation: [:progress |
>   Cursor wait makeCurrent.
>   progDialog caption: 'Loading Compounds...'.
>   self  importCompounds: progress.
>   progDialog caption: 'Loading Equipment...'.
>   self importEquipment: progress.
>   progDialog caption: 'Loading Process...'.
>   newProcess := self  importProcess: progress.
>   Cursor arrow makeCurrent].
>  progDialog allowCancel: false.
>  progDialog showModal.
> ==============

There's also a #text: selector that you might like better than #caption:.

Since I shot myself in the foot _many_ times<g>, I'm being very careful to
write a very convenient helper method do something like what you've done
above, but hide the details.  Do you have any ideas about what to do if the
block terminates abnormally?  I will probably end up trapping Error and
setting one of a couple of flags, but, (I think anyway) it would be nice to
have the progress dialog go away if the process it "protects" terminates.
My splash screens seem to do that well enough, but, they are not modal so
impatient users can (and do) get themselves into trouble.

Re the potential change, the only thing I can think of in D4 that would
cause trouble is if somebody went from adapter->subject->parent (or whatever
it would take) to locate the progress dialog and set the text.  For D5, I
suppose there could be collisions with the refactored presenter hierarchy,
but, since ProgressDialog probably isn't a value presenter, it might not
matter???

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.



Tue, 20 Apr 2004 20:56:39 GMT  
 Enhancement suggestion (half-baked)
Hello all,

There is a problem with my half-baked suggestion: ProgressDialog is a value
dialog :(   It appears that #forkOperation: takes advantage of this to cache
the value returned by the block (the one that does the real work).  However,
it might be possible to use another mechanism for caching and still get the
same behavior of making the dialog the argument rather than the value
adapter on the progress bar.  Actually, one could introduce another object
that responds to #value: and #text:, and maybe that's the better solution.

Having spent much of today trying to get something that works like my splash
screens but is modal, I now recall why I felt forced to use splash screens
some time ago: this is kinda tricky.  If I get anything that's useful and
not tied to proprietary stuff, I'll make it available for general use and
(hopefully) better suggestions.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.



Wed, 21 Apr 2004 03:46:51 GMT  
 Enhancement suggestion (half-baked)
Hello all,

You might want to (cautiously please) have a look at the following:

  http://needle.anest.ufl.edu/anest4/bills/TimedEvaluator.zip

File it in and look at the class side methods.  Comments/bug reports/better
ideas are all welcome.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.



Wed, 21 Apr 2004 06:09:10 GMT  
 Enhancement suggestion (half-baked)

Quote:
> There's also a #text: selector that you might like better than #caption:.

I don't remember why I used #caption: rather than #text:.  I think I was
going to use text for a more detailed progress display such as showing the
name of the item being imported and let the caption be more general.
However my design prohibits me form doing that since I pass the progress
value holder rather than a reffereence to the progress dialog.

Quote:
> Since I shot myself in the foot _many_ times<g>, I'm being very careful to
> write a very convenient helper method do something like what you've done
> above, but hide the details.  Do you have any ideas about what to do if
the
> block terminates abnormally?  I will probably end up trapping Error and

...

Code terminate abnormally?  Of course that never happens. ;)   Actually I
did run into that problem as I was developing the code and I ended up having
to do a  few (ProgressDialog allInstances first close)'s, or something like
that.  My code is not in a production environment yet so I do not have all
the error handling in place yet.  I think I could just use an #ifCurtailed:
around a block to close the ProgressDialog, or add more robust error
handling as needed.

I just saw your message with the attachment, I shall look at that now.

Chris



Sat, 24 Apr 2004 08:52:52 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Database half-baked?

2. Saving half-baked tcl scripts

3. Another latecomer; A half-baked suggestion.

4. lsort Half Numerical Half Text

5. half object/half dictionary

6. Simple View Composer Enhancement Suggestions

7. CW20: Enhancement \ Fixes : Suggestions

8. Inviting feature enhancement suggestions for gnuplotfortran

9. Whats about following enhancement suggestion?

10. Enhancement suggestion regarding menus

11. Suggestion for Enhancement to Tcl

12. Texture Baking for VRML Scene?

 

 
Powered by phpBB® Forum Software