How to raise a panel when mouse cursor moves over button?

Is it possible to raise a panel when moving the mouse cursor over the button containing the panel, or is a mouse click required? I have it working already with the mouse click method. Thanks for your suggestions. My code is:

*ButtonsNew: (Icon mini-question.xpm, Padding 0, Panel(down,indicator,delay 0) MiniButtons "Module FvwmButtons -g -30000-30000 MiniButtons")

It’s not possibly explicitly, although using FvwmAuto with -menter might help – see its manpage for more information.

– Thomas Adam

Thank you Thomas for your suggestion on using FvwmAuto. I have it doing about 80% of what I want. However, my method requires that I sometimes “touch” the button twice in order to raise the panel because in that case the panel is covered by another window. The button (ButtonsNew) is sticky and StayOnTop so is never covered. If you have a suggestion on a config that would make the panel raise if it is already being displayed but covered, and also raise if it isn’t raised already, and with only one “touch” of the button, then it would be perfect. I.e. I would like to “touch” the button only once for each case.
Thanks - Skip

[code]FvwmAuto 0 -passid -menter “Silent selective_raise raise”
“Silent selective_lower lower”

AddToFunc selective_raise

  • I WindowId $1 (ButtonsNew) FakeClick depth 0 press 1 wait 50 release 1
  • I WindowId $1 (ButtonsNewBot) FakeClick depth 0 press 1 wait 50 release 1

AddToFunc selective_lower

  • I WindowId $1 (ButtonsNewBot) $0
    [/code]

Well, the best thing you can do is to issue a “Raise” command in your function, which you’re already doing. You might find “RaiseLower” of use, although to ensure your window really does get raised over everything else, you can probably issue a function call that runs something like this:

[code]DestroyFunc raise-over-all
AddToFunc raise-over-all

  • I Layer 0 6
  • I Raise
    [/code]

Remember that raise will only raise a window within its own layer. If you have windows which are in different layers, then they might well get obscured — the above function ought to ensure this is not the case. I’ve used “6” as the likely upper layer, but do change it, if you have windows in layer 10, for instance (unlikely, but you never know.)

HTH,

– Thomas Adam

Thanks for you suggestions, Thomas. I managed to get the behavior that I wanted with the following config.

FvwmAuto 0 -passid -menter "Silent selective_raise raise" 

DestroyFunc selective_raise
AddToFunc selective_raise
+ I WindowId $1 (ButtonsNew) All (MiniButtons) Raise
+ I TestRc (NoMatch)  WindowId $1 (ButtonsNew) \
        FakeClick depth 0 press 1 wait 50 release 1
+ I WindowId $1 (ButtonsNewBot) All (MiniButtons2) Raise
+ I TestRc (NoMatch)  WindowId $1 (ButtonsNewBot) \
        FakeClick depth 0 press 1 wait 50 release 1

hmm. i don´t understand that :wink:. Because my english is to bad.

Can u explain this function with some screenshots?

Thanks

A screenshot wouldn’t really explain it (and I don’t know how to create screenshots anyway). So I’ll explain.

I use a 17 inch monitor and so I do not have space that I can dedicate to buttons only. So, I have created 2 buttons that are 3 pixels high and 400 pixels wide. One on the very top of the screen and one on the bottom. The size and shape of these button is such they do not interfere with other windows since they are also Sticky and StaysOnTop. Think FvwmTaskBar operation (sort of). They only block out a small amount of the border of another window, but no useful information is obscured. I can always access these buttons no matter what is on the screen. Also, each button just raises a button panel either when clicked or when the button receives focus (this is what FvwmAuto is used for). I prefer the panel to display when the button receives focus (why click when you don’t have to :slight_smile:). The button requires a mouse click to display the panel which is what FakeClick is for. However, the click is a toggle action. The first click displays the panel, the second click removes the panel. Therefore, I don’t want to have to click (or FakeClick) every time that the button has focus because the panel may be already displayed, but lowered below another window. That case would require a second click to get the panel back. The first line in the function [code]

  • I WindowId $1 (ButtonsNew) All (MiniButtons) Raise
    [/code]
    just checks if the mouse is in the ButtonsNew window AND if the MiniButtons panel is already displayed AND if both are true, then raise the MiniButtons panel to the top.

The next 2 lines [code]

  • I TestRc (NoMatch) WindowId $1 (ButtonsNew)
    FakeClick depth 0 press 1 wait 50 release 1
    [/code]
    checks if the return status of the previous command was false, AND if the mouse is in the ButtonsNew window AND if both are true, issue a FakeClick. Because the panel is not already displayed.

The rest of the function works on the bottom narrow button similarly.

The result is that I only have to move the mouse cursor over the narrow button and the panel is displayed. No clicking, no double clicking, no double mouse move on and off the narrow button. Just one move over the button. That’s all. Call me lazy if you like :slight_smile: but what are computers good for if not to remove tedium from our lives. :slight_smile: