[Q] FillInTheBlankMorph>>getUserResponse evil?
Ken Causey
ken at ineffable.com
Fri May 10 19:11:02 UTC 2002
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.
Ken
On Fri, 2002-05-10 at 14:02, Ned Konz wrote:
> On Friday 10 May 2002 11:50 am, Ken Causey wrote:
>
> > Maybe it's just me, but this seems evil and hacky. However, I'm
> > now in the position of needing a slightly more complex dialog and
> > my code really wants to wait for the response before continuing.
> > Is this logic the current best choice for waiting for a response
> > from the user? I can't seem to come up with a better solution so
> > far.
>
> An alternative is to make a standalone dialog box that will signal a
> semaphore or put a response on a queue. Then you can test this in
> your Morph's step method.
>
> You just have to keep track of what state you're in.
>
> Or you could have the OK button on the dialog call back to a method in
> your main Morph that would continue processing.
>
> --
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE
>
>
>
More information about the Squeak-dev
mailing list
|