Menubar Problem
David Burgun
dburgun at dsl.pipex.com
Mon Apr 18 05:48:33 EDT 2005
Hi,
Thanks for the help! I must admit I was becoming slight despondent
last night! All was failing around me. The main problem with the
menubar handling is that if there is a bug, it seems to really mess
up the IDE and it gets your stack into a state where it can't be
access via the IDE.
I think what happens is that, a scirpt in the card stack thats sets
the menu bar has an execution error, but for some reason this error
does not get handled by the IDE, it looks like the script still has
control and so the IDE never gets a chance to process the error and
therefore is hosed.
>>I have a dummy stack that I use to hold the menubar called
>>"MainMenu". All work fine if the "MainMenu" stack is visible, but
>>if I try to hide it, things start to go very wrong!!!!!
>>
>>Does the stack associated with the MenuBar have to be visible?
>>
>>I have this in the preOpenStack handler
>>
>>on preOpenStack
>>hide this stack
>>end preOpenStack
>>
>>If I replace this woth a show this stack all works fine!
>>
>
>Hi Dave,
>
>I use this technique too, but I never actually open the menubar stack.
>In the stack(s) where I want the menu to appear, I just have a line
>in the preOpenStack handler saying:
> set the menubar of me to "MyMenubar"
>and it all works fine.
>
>HTH,
>Sarah
Yes, it does, but if the stack is never opened, how does it know
where "MyMenubar" is? Also, does this work if a Standalone of the App
it built?
The way in which I have setup by app is as follows:
I have a MainMenu stack which is a Main Stack in it's own right.
Depending on the menu choices that are made, other main stacks in the
same folder get "go to" to'ed! And they do whatever process is
necessary. They call functions in the MainMenu Stack to control the
menu back and maybe to switch it to another menu bar. Also to enable
and disable menu items. That way all the menu bar handling is kept in
one stack.
I also keep global objects in various cards of this stack and they
can be accessed by any stack that was called from the MainMenu, this
works fine of course, except that the stack does need to be opened. I
guess I could just set it's screeen position to be way off the
visible area which would probably work (I will try it), but it would
be nice to be able to just hide it, since sometimes it's usufiul to
be able to show it in the message box.
The problem I have is if i enter "Browse" mode and then open the
MainMenu Stack if it's hidden I do not get the initial Menu Display,
so I cannot select something from the menu and so I can't get to the
Stack to be able to execute the code you have above! Sort of a
chicken and the egg problem! I haven't tried this
Any suggestion on how to make this work would be greatly appreciated.
Thanks in advance for any help
Dave
More information about the use-livecode
mailing list