General information
Category:
Menus & Menu designer
Title:
Named menu bars just don't work, do they?
Following on from two recent threads, here is a second example of code that apparently proves that "named" menu bars don't work. Or at least don't work in the simple way that I expected, which is to say as a way of storing multiple menu bar definitions and being ble to activate any one as required (basically different forms want different menu bars).
Perhaps someone knows what they are intended for, and why they can't be used in the way I visualise.
Try this:
* How do you swap between named menus? Not this way apparently.....
set sysmenu to default
* Define a couple of bars
*
define menu TESTBARA bar
define pad testbar1 of testbarA prompt "testbarA"
define menu TESTBARB bar
define pad testbar1 of testbarB prompt "testbarB"
*********************************************************************************
wait Window " METHOD 1. Simply activate one menu, then the other, then the first"
push menu _msysmenu && Save original
Wait window " Key to see bar A"
activate menu testbara nowait && Display bar a
Wait window " Key to see bar B"
activate menu testbarb nowait && Display bar b
Wait window " Key to see bar A (again), BUT you WON'T. "
activate menu testbara nowait&& Display bar a
Wait window "Key to see std _msysmenu (by a pop)"
pop menu _msysmenu && Won't work, interestingly it DOES show barA
Wait window "Oddly we now see barA. Key to see std sysmenu (by a default)"
set sysmenu to default && Clear up cockups
*********************************************************************************
wait Window " METHOD 2. Use deactiates as well as activates. This just doesn't work AT ALL. bara does not appear and then can't be deactivated"
push menu _msysmenu && Save original
Wait window " Key to see bar A"
activate menu testbara nowait && Display bar a
Wait window " Key to see bar B"
deactivate testbara
activate menu testbarb nowait && Display bar b
Wait window " Key to see bar A (again), BUT you WON'T. "
deactivate testbarb
activate menu testbara nowait&& Display bar a
Wait window "Key to see std _msysmenu (by a pop)"
pop menu _msysmenu && Won't work, interestingly it DOES show barA
Wait window "Oddly we now see barA. Key to see std sysmenu (by a default)"
set sysmenu to default && Clear up cockups
*****************
* Method 3. I give UP
return
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only