FillinTheBlankMorph>>getUserResponse

John Pierce john.raymond.pierce at gmail.com
Fri Dec 17 16:43:07 UTC 2004


Hi Frank,

On Fri, 17 Dec 2004 11:25:42 -0500, Frank Caggiano
<frankcag at crystal-objects.com> wrote:
> Ned,
> In the case of the 'ProvideAnswerNotification' section and your code
> example using it, can it be said that  this is analogous to
> setjmp/longjmp in C?  I tried using your example from a workspace

Since I am responsible for the ProvideAnswerNotification enhancements
(such as they are), I don't think I intended folks to use the
ProvideAnswerNotification stuff directly.  Not to stear you another
way, but a bunch of helpers were put on BlockContext to do what I
think you are trying.  Here's your sample code reworked the way I
think you wanted to make it work.

Instead of:
> Transcript show: 'Going in.'; cr.
>   [ FillInTheBlankMorph request: 'whatever' ]
>   on: ProvideAnswerNotification
>   do: [ :ex | ex return: 'response' ].
> Transcript show: 'Gone.';  show: r; cr

Do the following:

Transcript show: 'Going in.'; cr.
Transcript show: ([FillInTheBlankMorph request: 'whatever']
valueSupplyingAnswer: 'response');cr.
Transcript show: 'Gone.'; cr

So you send the message valueSupplyingAnswer: (one of many variants)
to provide an answer to these popup questions.  The reason I have many
helpers on BlockContext is for convenience (and probably confusion).

The many helpers are geared to make it simple to provide a standard
answer to any question (as the example above shows) or provide
specific answers to specific questions.

Finally, if you read through BlockContextTest you will find many
examples of this ProvideAnswerNotification in action and in it's many
forms.

Regards,

John

-- 
It is not because things are difficult that we do not dare, it is
because we do not dare that they are difficult. -- Seneca



More information about the Squeak-dev mailing list