Re: FVWM: Multiple arguments to MissingSubmenuFunction

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Sat, 10 Jan 2004 11:37:20 +0000

On 10 Jan 2004 11:22:05 +0000, Tavis Ormandy wrote:
>
> 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.

> 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}'

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.
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sat Jan 10 2004 - 05:39:32 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:56 BST