dialogues in non-gui code

Lex Spoon lex at cc.gatech.edu
Sat Dec 11 01:23:40 UTC 1999


"Josh Flowers" <josh at i33.com> wrote:
> 
> As an aside, what's the general feeling about having a method in a non GUI class that pops up a
> menu/dialog (in this case the StandardFileStream|readOnlyFileNamed)?  It seems a bit odd to me,
> but it was already there, so it seemed the best place for the fix.
> 



It's ubiquitous in Squeak (and perhaps all Smalltalks).  That said, I am
extremely mixed here.

I really like the way the existing stuff works.  It's nice that whenever
you open a file, you get a consistent error message if the file isn't
there, and a chance to fix things.  

On the other hand, this is madening if you write code that isn't
intended to be triggered from the UI.  As a case in point, it's
aggravating that a network server might call a socket routine and cause
debug windows to pop up for routine things like timeouts and dropped
connections.

The ideal solution would be to have the popups when the UI is around,
and not to have the popups when it isn't.  Perhaps exceptions would work
for this?  The UI defines special exception handlers for cases like
file-not-found, and non-UI code can simply catch the exception itself. 
Has anyone worked in a system that takes this approach?

The bad thing is that, even if people buy it, it means rewriting a bunch
of code.  #error: has 751 senders :(


Lex





More information about the Squeak-dev mailing list