I’ve changed the approach a bit, but the main problem remains. I still want to pass arguments from one menu to another, but I can’t.
So far, I’ve got two menus (WinOptsMenu and ObjectMenu).
WinOptsMenu contains the actions I want to take, EG Iconify, Close, Move, etc.
ObjectMenu contains the objects (things, mostly windows) I want to operate on, plus a positional argument, which should contain the command from the first menu.
[code]Key z A 4 PopUp WinOptsMenu
AddToMenu WinOptsMenu DynamicPopupAction WinOptsMenuFunc
AddToFunc WinOptsMenuFunc
- I DestroyMenu WinOptsMenu Recreate
- I AddToMenu WinOptsMenu “Window Options” Title
- I ThisWindow (Iconifiable) AddToMenu WinOptsMenu Iconify PopUp ObjectMenu Iconify
AddToMenu ObjectMenu DynamicPopupAction ObjectMenuFunc
AddToFunc ObjectMenuFunc
- I DestroyMenu ObjectMenu Recreate
- I AddToMenu ObjectMenu “Select Object” Title
- I AddToMenu ObjectMenu “Next” Next (AcceptsFocus, !Iconic) $0
- I AddToMenu ObjectMenu “Previous” Prev (AcceptsFocus, !Iconic) $0
- I AddToMenu ObjectMenu “” Nop
- I AddToMenu ObjectMenu “Current” Current (!Iconic, !Sticky) $0
- I AddToMenu ObjectMenu “Select” NoWindow Pick $0
- I AddToMenu ObjectMenu “” Nop
- I AddToMenu ObjectMenu “All (Desk)” All (CurrentDesk, !Iconic, !Sticky) $0
- I AddToMenu ObjectMenu “All (Page)” All (CurrentPage, !Iconic, !Sticky) $0
- I AddToMenu ObjectMenu “” Nop
- I AddToMenu ObjectMenu “Iconic (Desk)” All (CurrentDesk, Iconic, !Sticky) $0
- I AddToMenu ObjectMenu “Iconic (Page)” All (CurrentPage, Iconic, !Sticky) $0
- I AddToMenu ObjectMenu “” Nop
- I AddToMenu ObjectMenu “UnFocused (Desk)” All (CurrentDesk, !Focused, !Iconic, !Sticky) $0
- I AddToMenu ObjectMenu “UnFocused (Page)” All (CurrentPage, !Focused, !Iconic, !Sticky) $0
- I PopUp ObjectMenu[/code]
This however does not work, because the following line from WinOptsMenuFunc does not pass arguments (in this case “Iconify”) to my “ObjectMenuFunc”:
+ I ThisWindow (Iconifiable) AddToMenu WinOptsMenu Iconify PopUp ObjectMenu Iconify
I have it kind of working by replacing the above line with the following, which calls my “ObjectMenuFunc” directly from the “WinOptsMenu”:
+ I ThisWindow (Iconifiable) AddToMenu WinOptsMenu Iconify Function ObjectMenuFunc Iconify
This, however, is less than ideal because when the function ObjectMenuFunc gets run, the parent menu (WinOptsMenu) closes. I would like it to behave like “PopUp” IE keep the parent menu open and allow me to go back into it, should I need to.
Does anyone have a way to pass arguments (commands, conditions, etc.) from one menu to another, while keeping the parent menu open?
EDIT:
Will mark original as solved, as I can indeed pass arguments from one menu to another, even if I need to call the dynamic menu functions directly (rather than using “PopUp”) and therefore do not get exactly the same behavior as I would with PopUp. What I have is good enough for me.