Page 1 of 1

locking up

Posted: Wed May 22, 2013 5:58 pm
by leston12
If I user "answer ... " in the handler for the resizeStack message, the answer box shows but I can't dismiss it or continue with anything.

1. Why is this happening? Am I doing something 'unconventional' or what should I know that I don't know?

2. Is there a key combination that will break out of all handlers and let me down easy?

Thanks!

Re: locking up

Posted: Wed May 22, 2013 6:07 pm
by Klaus
Hi Leston,

this is correct behavior for "modal" dialogs!
Any script with an ASK or ANSWER will halt until the dialog is dismissed.

What are you trying to do?
On the Mac (ONLY!) you can:
...
ask "whatever..." AS SHEET
...
which will "pin" the dialog to the "calling" stack/window, the script will halt anyway
ut you can access other stacks like the message box.


Best

Klaus

Re: locking up

Posted: Wed May 22, 2013 6:12 pm
by leston12
Thanks Klaus.
I understand how 'modal' works, but the problem is this:
I click on the 'OK' button in the answer dialog and it DOES NOT dismiss the dialog.

I am working on a Mac, FWIW

Re: locking up

Posted: Wed May 22, 2013 6:18 pm
by Klaus
Hi Leston,
leston12 wrote:...I click on the 'OK' button in the answer dialog and is DOES NOT dismiss the dialog.
oh, this is very strange indeed!? Sorry, no spontaneous idea...


Best

Klaus

Re: locking up

Posted: Wed May 22, 2013 6:26 pm
by leston12
Klaus wrote:oh, this is very strange indeed!? Sorry, no spontaneous idea...
Yes it is! Can you replicate this? Try something like:

Code: Select all

on resizeStack
  answer "Try to close me."
end resizeStack

Re: locking up

Posted: Wed May 22, 2013 6:31 pm
by leston12
leston12 wrote:2. Is there a key combination that will break out of all handlers and let me down easy?
I have a hazy inkling of a memory from my earlier days of MC programming ... alt + alt or something like that .. ???
Is there such a thing still?

Re: locking up

Posted: Wed May 22, 2013 6:55 pm
by Klaus
Hi Leston,

you mean COMMAND + PERIOD.

Tried your script and it looks like "resizestack" is not a good buddy for an "answer" dialog :-D
Yes, locking up here, too, no idea if this is a bug or feature...


Best

Klaus

Re: locking up

Posted: Wed May 22, 2013 7:04 pm
by leston12
Klaus wrote:Tried your script and it looks like "resizestack" is not a good buddy for an "answer" dialog :-D
Yes, locking up here, too, no idea if this is a bug or feature...
Let's just call it an 'undocumented feature' ;-)

As always, Thanks for the help!

Re: locking up

Posted: Thu May 23, 2013 12:51 pm
by Klaus
Hi Leston,

I think you want to show the dialog AFTER the resizing has finished, right?

In one of my projects I had to deal with this situation and worked around the problem like this.
1. "SEND" a handler in 100 millisecs:

Code: Select all

on resizestack
   send "AnswerAfterResizing" to me in 100 millisecs
end resizestack
2. In that namely handler check if the mouse is NOT down -> still resizing!

Code: Select all

command AnswerAfterResizing
   if the mouse <> "up" then
      exit AnswerAfterResizing
   end if  
   answer "You resized me!"
end AnswerAfterResizing
Tested and works :-)


Best

Klaus