Very good observation. I had been baffled by pressing Esc on Quit dialog and having J disappear, when cancellation of action was expected. But I did not realize it is related to the wrong return code of the query box.
On Windows 7, ?5 is not a good argument--depending on parameter the value of Esc is different on it may even be disabled. But Esc+Esc in session first shows the quit box and then discards it without closing J, which is correct. Note also, that Esc in session should NEVER have invoked a quit box. "Esc" is for "discard", which is different from "close". Esc is appropriate to discard a dialog box though with an effect of NOT taking any action, i.e. as if the box never appeared. > From: Ian Clark <[email protected]> > > On my iMac, on entering: > > (?5) wdquery 'myapp' ; 'my message' > > if you press Esc or click the GoAway button in the window's titlebar, > this is equivalent to clicking OK, viz 0 is returned in all cases of > left arg. The same thing happens when you try to quit J itself and see > the message: "Do you want to exit J?" -- J exits on Esc / GoAway. > > One sad effect of that -- and I've seen it happen -- is that if a > trailing wire (stray elbow, cat's paw, etc) holds down the Esc button, > J promptly closes all its windows and terminates. > > This seems counterintuitive to me. A user might expect that GoAway / > Esc equates to Cancel, not OK. Other Mac apps (eg TextEdit) disable > the GoAway within a confirmation dialog, eg on quitting with an > unsaved document... and Esc is equivalent to Cancel, not "Save..." or > "Don't Save". > > I know it's an OAFWD ("Only A Fool Would Do it!"). But my users don't > possess our level of intelligence. How can I detect GoAway / Esc, to > override this behaviour? > > Ian > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
