[squeak-dev] Re: Possible Background fix

Juan Vuletich juan at jvuletich.org
Tue Jan 25 12:57:35 UTC 2011


Mirko Kapps wrote:
> On 22.01.2011 22:09, Casey Ransberger wrote:
>> If it was me, I'd probably try to load the image, and handle the 
>> error that came back if it's missing with my fallback code.
>>
>> I always wind up going to google when I need an exception handler in 
>> Squeak. I don't need them often enough to remember the idiom, which 
>> is odd, coming from other languages. I think it falls out of the 
>> uniform object/message protocol, I suppose. If mostly the only error 
>> is "I didn't understand that message" and polymorphism is used 
>> pervasively, I guess exceptions only happen once in awhile.
>>
>> Is it weird that I'm surprised when exceptions only occur in 
>> exceptional circumstances?
>>
>> Anyway if you think an exception handler will give you what you want, 
>> I found an example for you here:
>>
>> http://lists.squeakfoundation.org/pipermail/beginners/2008-September/005041.html 
>>
>
> Thanks for the link.
>
> So if I understand you correctly, working with exception is rather 
> "un-squeaky"? It's quite common in Python, so I have to adjust a little.
>
> FWIW, I've played around and now #setBackground: also accepts an Array 
> and even a Form for gradients, though that doesn't work correctly yet, 
> I haven't found out how to create a gradient which resizes if the Cuis 
> window is resized.
>
> It now also sets Theme>>background as the fall-back if the file is 
> missing and no alternative is given.
>
> Feel free to include/tweak/reject any or all of it. ;-)
>
>
> One question:
>
> When the file is not found, I display a note on the Transcript, when I 
> now file out the change, I get a message:
>
> Methods in this fileOut have halts or references to the Transcript or 
> other 'slips' in them. Would you like to browse them?
> - Ignore
> - Browse slips
>
> Why is that? Is displaying such warnings/info on the Transcript a bad 
> thing to do? If yes, what to do instead?
>
>
> Kindest Regards and good night
> Mirko

Hi Folks,

I apologize for the delay in answering...

I think that Themes specifying a background image is a good thing. What 
I don't like is dependency on external files. It is better if the Theme 
can provide the image itself (i.e. the Form) and not a file name. There 
are many examples in the image on how to do this, as this is how icons 
and fonts are created. Depending on the kind of image, it might be 
better to encode it using either jpg or png.

Cheers,
Juan Vuletich



More information about the Squeak-dev mailing list