Hi Bob,

> Am 20.05.2016 um 17:58 schrieb Bob Sneidar <[email protected]>:
> 
> 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
[email protected]


_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to