Possible display/answer dialog bug

Klaus major-k klaus at major-k.de
Fri May 20 18:34:28 CEST 2016


Hi Bob,

> Am 20.05.2016 um 17:58 schrieb Bob Sneidar <bobsneidar at iotecdigital.com>:
> 
> 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
>   do tCommand
> end answerLocal
> 
> then using:
> 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? 

try setting „the defaultstack“ to your „target“ stack, worked here in a quick test 
with one button in a stack „untitled 1“:
on mouseup
put „For :-)“ into pMsg
 set the defaultstack to "t1"
 answer warning pMsg as sheet
end mouseup

And the sheet appeared in the (not in front) stack „t1“!

> Bob S

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major-k.de




More information about the use-livecode mailing list