[Newbies] User Interrupt window

Ron Teitelbaum ron at usmedrec.com
Sat Dec 9 20:35:05 UTC 2017


You can use Sensor instead.

All the best,

Ron Teitelbaum

On Sat, Dec 9, 2017 at 2:56 PM, obrienj <obrienj at protonmail.com> wrote:

> Squeak complains that it doesn't know InputSensor.
>
>
>
> -------- Original Message --------
> Subject: Re: [Newbies] User Interrupt window
> Local Time: December 9, 2017 10:06 AM
> UTC Time: December 9, 2017 6:06 PM
> From: ron at usmedrec.com
> To: obrienj <obrienj at protonmail.com>, A friendly place to get answers to
> even the most basic questions about Squeak. <beginners at lists.
> squeakfoundation.org>
>
> Hi OBrien J
>
> One way to do this is to install a new interruptWatcher on Sensor.
>
> On the class you want to handle the message do something like
>
> Sensor installInterruptWatcher:[self userInterruptWatcher].
>
> Yourclass >> userInterruptWatcher
> "Wait for user interrupts and open a notifier on the active process when
> one occurs."
> | interruptSemaphore |
> interruptSemaphore := InputSensor interruptSemaphore.
> [true] whileTrue: [
> interruptSemaphore wait.
> self signal: #userInterrupt.
> ].
>
> Then implement your handler with something like onUserInterrupt to respond
> to the signal.  Or you could just call a method in your class to handle the
> interrupt.
>
> Hope that helps!
>
> All the best,
>
> Ron Teitelbaum
>
>
> On Sat, Dec 9, 2017 at 12:09 PM, obrienj <obrienj at protonmail.com> wrote:
>
>> Is there a way to intercept the 'User Interrupt'  window that pops up
>> when the user types the interrupt key and replace it with a customized
>> dialog window? I've used on: do: to intercept Error messages but can't seem
>> to do the same with EventSensor messages.
>>
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20171209/96eb0b9d/attachment-0001.html>


More information about the Beginners mailing list