Unable to DestroyMenu created by MissingSubmenuFunction

I’m messing around with Pipereads in menus and a couple times now I’ve run into a situation where a menu created by MissingSubmenuFunction doesn’t get destroyed when it is redrawn and won’t change what it displays until a restart of FVWM.

I’ve tried “DestroyMenu recreate $0” before a Piperead in the function called by MissingSubmenuFunction, as well as echoing “DestroyMenu recreate $1” inside the script being Piperead (where $1 is $0 passed to the script).

Is this by design?

Also, might be on your todo list already: It would be great if we could pass multiple arguments to MissingSubmenuFunction.

Incorrect.

Can you post me your config which shows this problem?

– Thomas Adam

As I think this through, I’ve decided the Menu IS getting destroyed or the menu would get more and more items added each time it is viewed.

I still don’t understand why the below happens though.

  1. Create ~/testdir/ and add some files.
  2. View TestMenu (Results: all files listed.)
  3. Delete a file from ~/testdir/
  4. View TestMenu - (Results: all files still listed, even the deleted one.)

[code]DestroyMenu TestMenu
AddToMenu TestMenu

  • MissingSubmenuFunction FuncTestMenu
  • “Test Menu” Title
  • “Item 1” Popup sub

DestroyFunc FuncTestMenu
AddToFunc FuncTestMenu

  • I Piperead ‘$[fvwm_script]/testmenu $0’
    [/code][code]#!/bin/bash

echo “DestroyMenu recreate $1”
echo “AddToMenu $1 $1 Title”

for i in ls ~/testdir/; do
echo “AddToMenu $1 $i”; done
[/code]

Thanks

You’re doing it wrong, is all.

MissingSubMenuFunction operates differently to the one you want, which in this content is DynamicPopupAction. Here’s a contrived example:

DestroyMenu MenuA
AddToMenu MenuA DynamicPopupAction FuncB

DestroyFunc FuncB
AddToFunc FuncB
+ I DestroyMenu recreate MenuA
+ I PipeRead '$[HOME]/foo.sh MenuA'

Menu A

And you can also replace your, err, script with something which uses fvwm-menu-directory.

– Thomas Adam

The script I’ve shown you is just a proof of concept to show you my issue, not the actual script.

I know about DynamicPopupAction. I usually use it for the top-level of my scripted menus. I want to pass arguments to the sub-menu, that’s why I used MissingSubmenuFunction.

You’re still not understanding.

MissingSubMenuFunction is not about passing multiple arguments around because of a lacking in DynamicPop{Up,Down}.

Oh. Thank you for explaining.