Menus
James Spencer
jspencer78 at mac.com
Fri Nov 19 13:19:01 EST 2004
Menus are just plain driving me nuts and I'm hoping someone can at
least explain this behavior with the goal that maybe I can understand
what is happening for future reference.
The particular project at hand uses four stacks, one of which is really
nothing more than a splash screen although it also contains some
utility stuff for manipulating the other stacks. The actual
application primarily consists of two other stacks. The fourth stack
is, at Sarah Reichelt's suggestion (thank you again Sarah) a stack I
use just for menu development so I don't have to sweat the nonsense of
how Mac menus are handled. I created my main menu bar on that stack
(the group is named "Main Menu Bar") and I use it in the other three
stacks by "set menuBar of this stack to "Main Menu Bar". Then, because
at one time, I had thought it would be helpful to have a different set
of menus when the utilities in the first stack were displayed, I copied
my "Main Menu Bar", named this second bar "Utility Menus" and had a
line in my preOpenStack handler in the utility stack to "set MenuBar of
this stack to "Utility Menus". Again, this worked fine and I could
change back and forth with the correct menus being displayed.
I eventually decided I did not need this second set of menus, that the
one set would work fine for all purposes just enabling and disabling
items (as an aside I've reached the conclusion that one thing I don't
like in Rev's development environment over working with say
Xcode/InterfaceBuilder or other IDE's is how dramatically the menus
change depending on context but that's just me) as appropriate. So, I
DELETED the "Utility Menus" group from my menu stack. I've gone
through all four stacks with the application browser and the group with
it's corresponding buttons are definitely gone.
Now, here's what I don't get. I forgot to delete out my line of script
in the utility stack that "set menuBar of this stack to "Utility Menus"
and lo and behold, the old menu bar, the one that doesn't seem to be in
the stack anywhere, continues to appear when the utility stack is in
front. How can this be? I've got my application working correctly now
by changing the set menuBar line to set the correct menu bar but how
come I wasn't getting an error when I was setting the menuBar to a
non-existent menu? Inquiring minds simply would like to know.
Spence
James P. Spencer
Rochester, MN
jspencer78 at charter.net
"Badges?? We don't need no stinkin badges!"
More information about the use-livecode
mailing list