I’ve created a FvwmIconMan module which shows iconified apps like amarok or xmms (it’s a pseudo systray). Now I want a popup menu with some functions like play, next, previous or maximize when I click the icon with the right mouse button. How can I do that?
I have considerate to go over the tip name which appears if I move over the particular icon to choose the right menu, but I found nothing how I can get the name shown in the tip.
Can anybody help me?
Btw does exists a list of FVWM variables? If yes, where?
what do you mean with
“Or if you wanted it specific for a certain application, you’re going to have to use FvwmButtons, and qualify the window to produce a custom menu.” ?
The icons shown in the FvwmIconMan module are iconified running apps! Why should I create buttons for these apps?
Perhaps I verbalize it wrong. Please have a look at my screenshot ( http://www.lynucs.org/index.php?screen_id=213455111543bb1caf6731f&p=screen )
-> right below you see a field with one icon (kontact) under the tip and left above you see its thumbnail. So what I want is for this app a right click popup menu.
Your code with the action line is good (I have taken it for deiconify the app with the left mouse click) but how can I bind it to the specific icon? Is there a variable for the tip?
You don’t, it’s just what I would have done, since it is much easier to direct individual entities in FvwmButtons. If you wanted to do it via FvwmIconMan, the only way I can think you could do it is to destroy and recreate the menu each time. So something like this…
*FvwmIconMan: Action Mouse 3 N sendcommand "Popup specialMenu"
… which tells FVWM we want a specific menu to popup. Now, this menu is going to have to be destroyed and recreated each time, to take into account the likely window it will be operating on. So that’s the first thing to add to this menu:
… which just creates a new menu on the popup action. I could have used “DestroyMenu recreate foo”, but there’s no need here. Here, the DynamicPopupAction is calling a function “CheckWindows” which will be the function to create a menu based on what you select. We’re also passing a parameter into it – the menu that will house these options – “specialMenu” in this case. So, “CheckWindows”:
DestroyFunc CheckWindows
AddToFunc CheckWindows
+ I DestroyMenu $0
+ I AddToMenu $0
+ I ThisWindow ("xmms") AddToMenu $0 "play" "Exec exec xmms -foo"
+ I ThisWindow ("gaim") AddToMenu $0 "gaim foo" "Exec exec gaim -foo"
+ I ThisWindow AddToMenu $0 "" Nop
+ I ThisWindow ("other") AddToMenu $0 "other foo" "Exec exec other --foo"
....
“CheckWindows” is the function, and “specialMenu” is a parameter, which FVWM knows as “$0”. If I were to pass more parameters into a function, then they would be “$1”, “$2”, etc, depending on how many I were passing to it.