[squeak-dev] Re: Possible Background fix

Casey Ransberger casey.obrien.r at gmail.com
Sun Jan 23 05:12:21 UTC 2011


No, exceptions happen all the time, it just seems that I need to deal with them less often than I do in certain other languages. 

Far as the Transcript warning goes, that's just to remind you that 

Transcript show: 'Argh WTF are you nil?' , object.

...doesn't really belong in Etoys:)

People use the Transcript a lot to do the equivalent of printf() debugging, and the system likes to remind you that you've left messages to the transcript in your methods. 

Like any form of logging or console output, the goal is to communicate effectively with the user without being spammy. Make sense?

On Jan 22, 2011, at 5:17 PM, Mirko Kapps <mirkok.lists at googlemail.com> 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
> <setBackground.1.cs>
> 



More information about the Squeak-dev mailing list