Subject: FVWM: Multiple arguments to MissingSubmenuFunction

From: Tavis Ormandy <[email-masked]>
Date: Sat, 10 Jan 2004 11:22:05 +0000

Is there anyway to pass more than just the path to MissingSubmenuFunction?

I have a menu like this:

DestroyMenu MenuMultimedia
AddToMenu MenuMultimedia
+   MissingSubmenuFunction FuncFvwmMenuDirectory
(...)
+   ""                                      Nop
+   %hardware_video_camera_display.png%"Browse Videos"  Popup
$[fvwm_video_path]
+   %music_notes_view.png%"Browse Music"    Popup $[fvwm_audio_path]
+   %graphics_presentation_person.png%"Browse Images"   Popup
$[fvwm_image_path]

It would be cool if i could pass some other arguments to
MissingSubmenuFunction to specify an icon/--exec-file to use depending on
menu selected, but there doesnt seem to be an easy way to do this..This is
what I've done right now, but I'm sure there is a better way:

DestroyFunc FuncFvwmMenuDirectory
AddToFunc FuncFvwmMenuDirectory
+ I PipeRead 'myexec=gvim mypng=file_text_view.png; \
    case $0 in \
        $[fvwm_rom_path]*) myexec=$[fvwm_rom_exec]
mypng=games_puzzles_dice.png;; \
        $[fvwm_video_path]*) myexec=$[fvwm_video_exec] mypng=film.png;; \
        $[fvwm_audio_path]*) myexec=$[fvwm_audio_exec] mypng=audio.png;; \
        $[fvwm_image_path]*) myexec=$[fvwm_image_exec]
mypng=graphics_presentation_person.png;; \
    esac; \
    fvwm-menu-directory --icon-title folder_view.png --icon-file ${mypng}
--icon-dir folder_paper_closed.png \
    --dir $0 --xterm exec --exec-file ${myexec}'

I'm using 2.5.8, my fvwm2rc is here
http://dev.gentoo.org/~taviso/fvwm2rc.html

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 10 Jan 2004 11:37:20 +0000

> Is there anyway to pass more than just the path to MissingSubmenuFunction?

No, there is no way. And this is indeed quite limited if one wants to
define non-trivial dynamical menus.

>     --dir $0 --xterm exec --exec-file ${myexec}'

This is the best way until there is a way to pass more parameter to the
MissingSubmenuFunction's function than the missing menu name, say:

  Popup (PassArgs "argument-1" "argument-2" "argument-3") missing-menu

Regards,
Mikhael.