Hi.

I want to have entries in the window menu for toggling
some aspects of the window like shading. I want this entry
to be named accodingly to the actual state of the window.
For instance, if the window is shaded, the menu entry
shuld be "Shade", otherwise "Unshade".

To solve this I am using dynamic menus, as can be seen
in the attached file containing relavant parts of the
configuration.

This works with the title button 1, which is the window
menu button. But it fails with the icons in the
FvwmIconMan module. In this case the menu entries are
not always named correctly, picking the wrong state
(for instance, showing Deiconify instead of Iconify).

Any hints on how to solve this problem?

Romildo
# A dynamic popup menu for the window operations
# Some entries depend on the window state

AddToMenu WindowMenu "Window" Title
+ DynamicPopupAction Function WindowMenuF

DestroyFunc WindowMenuF
AddToFunc WindowMenuF
+ I DestroyMenu recreate WindowMenu
+ I AddToMenu WindowMenu "Window" Title
+ I + "&Move"                   Move
+ I + "&Resize"                 Resize
+ I + "R&aise"                  Raise
+ I + "&Lower"                  Lower
+ I Current (Iconic) + "De&iconify"     Iconify
+ I Current (!Iconic) + "&Iconify"      Iconify
+ I Current (Sticky) + "Un&stick"       Stick
+ I Current (!Sticky) + "&Stick"        Stick
+ I Current (Shaded) + "Un&shade"       WindowShade
+ I Current (!Shaded) + "&Shade"        WindowShade
+ I Current (Maximized) + "Unma&ximize" Maximize layer grow grow
+ I Current (!Maximized) + "Ma&ximize"  Maximize layer grow grow
+ I Current (!Maximized) + "Maximize &Vertical" Maximize layer 0 grow
+ I Current (!Maximized) + "Maximize &Horizontal"       Maximize layer grow 0
+ I + ""                        Nop
+ I + "Move to &Desk"           Popup MoveToDeskMenu
+ I + "Title Position"          PopUp TitlePosMenu
+ I + ""                        Nop
+ I + "Identify"                Module FvwmIdent
+ I + "ScrollBar"               Module FvwmScroll 2 2
+ I + "Print"                   PrintFunction
+ I + "Print Reverse"           PrintReverseFunction
+ I + ""                        Nop
+ I + "&Delete"                 Delete
+ I + "&Close"                  Close
+ I + "Destroy"                 Destroy

# This one works
Mouse 1         1       A       Menu WindowMenu Nop

# This one does not work for some entries
*FvwmIconMan: Action Mouse 3 N \
  sendcommand 'Menu WindowMenu Rectangle +$[left]+$[top] 0 -100m'

Reply via email to