[squeak-dev] Re: Possible Background fix

Mirko Kapps mirkok.lists at googlemail.com
Sun Jan 23 01:17:20 UTC 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setBackground.1.cs
Type: text/x-csharp
Size: 1258 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110123/b60c3803/setBackground.1.bin


More information about the Squeak-dev mailing list