[Q] FillInTheBlankMorph>>getUserResponse evil?

Ned Konz ned at bike-nomad.com
Fri May 10 19:20:48 UTC 2002


On Friday 10 May 2002 12:11 pm, Ken Causey wrote:
> Godfroy on #squeak suggested the same solution I believe. 
> Basically forking off a thread and the original method waits on a
> response passed through a SharedQueue.  Where I'm getting lost is
> what code to fork and how/why the event gets processed in the
> thread.  Maybe I just need to stop thinking about it and give it a
> try.

Actually, you don't want to fork. The problem with forking is that you 
can't fork a dialog box from a non-UI thread.

Imagine this:

Someone hits a button or something that makes your Morph want to get 
data from the user.

Your Morph constructs a dialog box with an entry field and a couple of 
buttons. The OK button (and accept in the text field?) is wired so 
that it calls a userInput: method in your main Morph.

Your Morph notes that it is waiting for data. It may also disable 
other UI elements so that the user doesn't get confused.

When the callback occurs (when your Morph's userInput: method is 
called), your Morph knows that it is waiting for data for a 
particular reason. It takes the user data and continues doing what it 
needed the user input to do.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list