Possible display/answer dialog bug
bobsneidar at iotecdigital.com
Fri May 20 11:58:40 EDT 2016
Sorry for the verbosity of this post.
Okay here is a possible menu display bug that only will affect OS X. I have a main stack and a number of substacks I call "Modules." Each has it's own menu which contains a button called "Modules" so no matter where I am I can open any of the other modules. However, the code for navigating to these "Modules" is in the Main Stack module menu button (so I only have one place to go to modify the code). The other modules simply call the menuPick in the Main Stack menu script, passing the menu parameter.
Here's the problem. If the main stack is not visible, and I call answer with "as sheet" from the main stack menu, I get the normal dialog, NOT a sheet attached to the topStack. Apparently "as sheet" will only attach the dialog to the stack of the script CALLING it, and NOT to the topStack, which to me is a kind of anomaly.
Now I thought I could get around this by using:
send ("answer warning " & tMsg & " as sheet") to stack tTopStack
but what I get is a detached answer dialog where the message is "For" (do not ask me where the hell THAT came from.) "For" does not occur anywhere in tMsg.
I can work around this using this handler in each module's stack script:
on answerLocal pMode, pMsg
put "answer" && pMode && quote & pMsg& quote && "as sheet" into tCommand
dispatch answerLocal to stack tTopStack with "Warning", tMsg
Still, I'm wondering if this is the intended behavior. Shouldn't "as sheet" be directed to whatever stack is the topStack and not the calling stack?
More information about the Use-livecode