<div>Tried it but nothing changed. <br></div><div><br></div><div>Looking at Debugger's methods, it appears that typing the interrupt key opens a notifier (the User Interrupt window), which gives the user the option to abandon the interrupted process. Is there a way to add a method to a program so that typing the interrupt key  simply abandons the running process without the notifier opening?<br></div><div><br></div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><div><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><blockquote class="protonmail_quote" type="cite"><div>-------- Original Message --------<br></div><div>Subject: Re: [Newbies] User Interrupt window<br></div><div>Local Time: December 15, 2017 12:45 AM<br></div><div>UTC Time: December 15, 2017 8:45 AM<br></div><div>From: marcel.taeumel@hpi.de<br></div><div>To: obrienj <obrienj@protonmail.com><br></div><div>beginners@lists.squeakfoundation.org, hosihanh via Squeak-dev <squeak-dev@lists.squeakfoundation.org><br></div><div><br></div><div style="font-size: 12pt;font-family: calibri;color: #000000"><div>Okay, such process-switching code can be tricky. If you keep that suspended process around for a while the Transcript's semaphore will block other semaphore uses. So, try this:<br></div><div><br></div><div><div>interrupt: process label: string<br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>"ToolSet register: self; default: self"<br></div><div><br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>Project current<br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>spawnNewProcessIfThisIsUI: process;<br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>addDeferredUIMessage: [self inform: string].<br></div><div><br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>process terminate.<br></div></div><div><br></div><div>If you want to execute more code, better write it into the block sent via #addDeferredUIMessage:. <br></div><div><br></div><div>Best,<br></div><div>Marce.<br></div><div class="mb_sig"><br></div><blockquote style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px" type="cite" class="history_container"><p style="margin-top: 10px;"><span class="colour" style="color:rgb(170, 170, 170)">Am 15.12.2017 09:29:10 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</span><br></p><div style="font-size: 12pt;font-family: calibri;color: #000000"><div>...hmmm... this test seems to lock the Transcript's input semaphore. So, after CMD+Dot via MyToolSet, any calls to "Transcript show:" will freeze. Interesting.<br></div><div><br></div><div>Any ideas?<br></div><div><br></div><div>Best,<br></div><div>Marcel<br></div><div class="mb_sig"><br></div><blockquote style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px" type="cite" class="history_container"><p style="margin-top: 10px;"><span class="colour" style="color:rgb(170, 170, 170)">Am 15.12.2017 09:22:52 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</span><br></p><div style="font-size: 12pt;font-family: calibri;color: #000000"><div>Hi Jim,<br></div><div><br></div><div>well, the Debugger takes care of re-spawning a new UI process in case the interrupted one was the UI process. :-) You should do that, too:<br></div><div><br></div><div><div>interrupt: process label: string<br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>"ToolSet register: self; default: self"<br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>Project current spawnNewProcessIfThisIsUI: process.<br></div><div><span style="white-space:pre" class="Apple-tab-span"></span>self inform: string.<br></div></div><div><br></div><div>Best,<br></div><div>Marcel<br></div><div><br></div><div><br></div><div class="mb_sig"><br></div><blockquote style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px" type="cite" class="history_container"><p style="margin-top: 10px;"><span class="colour" style="color:rgb(170, 170, 170)">Am 14.12.2017 17:30:06 schrieb obrienj <obrienj@protonmail.com>:</span><br></p><div>Hi Marcel,<br></div><div><br></div><div>I made MyToolSet, a subclass of StandardToolSet, and added a copy of #interrupt:label to it.<br></div><div><br></div><div>I next created HaltExperiment as an Object subclass and added this simple, infinite loop method:<br></div><div><br></div><div>infiniteLoop <br></div><div>| x | <br></div><div>ToolSet register:  MyToolSet.<br></div><div>ToolSet default:  MyToolSet. <br></div><div>Transcript clear. 

x := 0.<br></div><div>[x >= 0] whileTrue: [x := x + 1. Transcript show: 'x = ', x; cr.].<br></div><div><br></div><div>As a test, I commented out the code in StandardToolSet’s #interrupt:label:, which stops the User Interrupt window from appearing but also causes Squeak to freeze after typing the interrupt key. Unfortunately, running HaltExperiment new infiniteLoop didn't restore the appearance of the User Interrupt window or stop Squeak from freezing even though MyToolSet has a complete copy of #interrupt:label:.<br></div><div><br></div><div>What am I doing wrong? How do I implement MyToolSet's #interrupt:label so that a dialog window appears with its own message to the user when infiniteLoop is interrupted?<br></div><div><br></div><div>Thanks,<br></div><div>Jim<br></div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><div><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><blockquote style="min-width: 500px" type="cite" class="protonmail_quote"><div>-------- Original Message --------<br></div><div>Subject: Re: [Newbies] User Interrupt window<br></div><div>Local Time: December 9, 2017 9:54 AM<br></div><div>UTC Time: December 9, 2017 5:54 PM<br></div><div>From: marcel.taeumel@hpi.de<br></div><div>To: obrienj <obrienj@protonmail.com>, beginners@lists.squeakfoundation.org<br></div><div><br></div><div style="font-size: 12pt;font-family: calibri;color: #000000"><div>Hi, there.<br></div><div><br></div><div>1) Subclass StandardToolSet.<br></div><div>2) There, implement #interrupt:label: as you want it.<br></div><div>3) Set your new tool set via "ToolSet register: MyToolSet" and "ToolSet default: MyToolSet".<br></div><div><br></div><div>Note that ToolSet is an AppRegistry and hence a wrapper whereas StandardToolSet is an actual tool set. :-) Other app registries include WebBrowser and SoundService.<br></div><div><br></div><div>The user interrupt is not implemented with exceptions but a watchdog process and a special semaphore. See EventSensor >> #userInterruptWatcher for more information.<br></div><div><br></div><div>Best,<br></div><div>Marcel<br></div><div class="mb_sig"><br></div><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px"><p style="margin-top: 10px;"><span class="colour" style="color:rgb(170, 170, 170)">Am 09.12.2017 18:09:51 schrieb obrienj <obrienj@protonmail.com>:</span><br></p><div>_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners <br></div><div>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.<br></div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><div><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div></blockquote></div></blockquote><div><br></div></blockquote></div></blockquote></div></blockquote></div></blockquote><div><br></div>