locking up

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm

locking up

Post by leston12 » Wed May 22, 2013 5:58 pm

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!
Leston

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: locking up

Post by Klaus » Wed May 22, 2013 6:07 pm

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

leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm

Re: locking up

Post by leston12 » Wed May 22, 2013 6:12 pm

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
Last edited by leston12 on Wed May 22, 2013 6:20 pm, edited 1 time in total.
Leston

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: locking up

Post by Klaus » Wed May 22, 2013 6:18 pm

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

leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm

Re: locking up

Post by leston12 » Wed May 22, 2013 6:26 pm

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
Leston

leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm

Re: locking up

Post by leston12 » Wed May 22, 2013 6:31 pm

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?
Leston

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: locking up

Post by Klaus » Wed May 22, 2013 6:55 pm

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

leston12
Posts: 25
Joined: Thu Mar 28, 2013 8:25 pm

Re: locking up

Post by leston12 » Wed May 22, 2013 7:04 pm

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!
Leston

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: locking up

Post by Klaus » Thu May 23, 2013 12:51 pm

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

Post Reply