The Trunk: MorphicExtras-cmm.131.mcz

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

The Trunk: MorphicExtras-cmm.131.mcz

commits-2
Chris Muller uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-cmm.131.mcz

==================== Summary ====================

Name: MorphicExtras-cmm.131
Author: cmm
Time: 8 December 2013, 2:41:26.401 pm
UUID: f74322c1-1b8d-4e99-a939-99a931534a27
Ancestors: MorphicExtras-nice.130

Make dependency on UpdateStream dynamic rather than static.

=============== Diff against MorphicExtras-nice.130 ===============

Item was changed:
  ----- Method: PaintBoxMorph>>loadColorChooser (in category 'initialization') -----
  loadColorChooser
  "Load Forms for ColorMemoryMorph."
 
  | doc closedForm openForm |
+ (Smalltalk hasClassNamed: #UpdateStreamDownloader) ifFalse: [ Installer new merge: #updateStream ].
+ doc := (Smalltalk classNamed: #UpdateStreamDownloader) default objectStrmFromUpdates: 'colorPalClosed.obj'.
- doc := UpdateStreamDownloader default objectStrmFromUpdates: 'colorPalClosed.obj'.
  closedForm := doc fileInObjectAndCode mapColor: Color transparent to: Color black.
+ doc := (Smalltalk classNamed: #UpdateStreamDownloader) default objectStrmFromUpdates: 'colorPalOpen.obj'.
- doc := UpdateStreamDownloader default objectStrmFromUpdates: 'colorPalOpen.obj'.
  openForm := doc fileInObjectAndCode mapColor: Color transparent to: Color black.
 
  colorMemoryThin image: closedForm.
  colorMemoryThin position: self position + (0@140).
 
  colorMemory delete. "delete old one"
  colorMemory := PaintBoxColorPicker new image: openForm.
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: MorphicExtras-cmm.131.mcz

Frank Shearar-3
On 8 December 2013 20:41,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of MorphicExtras to project The Trunk:
> http://source.squeak.org/trunk/MorphicExtras-cmm.131.mcz
>
> ==================== Summary ====================
>
> Name: MorphicExtras-cmm.131
> Author: cmm
> Time: 8 December 2013, 2:41:26.401 pm
> UUID: f74322c1-1b8d-4e99-a939-99a931534a27
> Ancestors: MorphicExtras-nice.130
>
> Make dependency on UpdateStream dynamic rather than static.
>
> =============== Diff against MorphicExtras-nice.130 ===============
>
> Item was changed:
>   ----- Method: PaintBoxMorph>>loadColorChooser (in category 'initialization') -----
>   loadColorChooser
>         "Load Forms for ColorMemoryMorph."
>
>         | doc closedForm openForm |
> +       (Smalltalk hasClassNamed: #UpdateStreamDownloader) ifFalse: [ Installer new merge: #updateStream ].
> +       doc := (Smalltalk classNamed: #UpdateStreamDownloader) default objectStrmFromUpdates: 'colorPalClosed.obj'.
> -       doc := UpdateStreamDownloader default objectStrmFromUpdates: 'colorPalClosed.obj'.
>         closedForm := doc fileInObjectAndCode mapColor: Color transparent to: Color black.
> +       doc := (Smalltalk classNamed: #UpdateStreamDownloader) default objectStrmFromUpdates: 'colorPalOpen.obj'.
> -       doc := UpdateStreamDownloader default objectStrmFromUpdates: 'colorPalOpen.obj'.
>         openForm := doc fileInObjectAndCode mapColor: Color transparent to: Color black.
>
>         colorMemoryThin image: closedForm.
>         colorMemoryThin position: self position + (0@140).
>
>         colorMemory delete.     "delete old one"
>         colorMemory := PaintBoxColorPicker new image: openForm.
>   !

OK, I see what you mean. We do this kind of lazy loading in several
places. Every time I see it, I feel a strong ambivalence. On one hand,
it's really easy to write, and it's really convenient, but! (b) it's a
totally rubbish UX when you're offline. Click on something and
suddenly random failures happen because omigosh you're not connected
to the internet.

I think lazy loading like this should be a last resort. Surely we can do better?

frank