Re: FVWM: 2 states for a button

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Fri, 25 Jan 2002 19:04:39 +0000

On 25 Jan 2002 19:02:00 +0100, Anders K. Lyhne Th0gersen wrote:
>
> I've decided to take some time to costumize my favorite windomanager so it
> becomes even cooler, but i have run into a problem i can't fix...
>
> I would like to add a sticky button that appears to be pressed down when
> pressed the first time, and when pressed again it switches back to look as
> it did before it was pressed, and the window will no longer be stuck.
>
> I have been trying with statements similar to these:
>
> AddButtonStyle 3 ActiveUpToggled 2 70x15_at_0 30x55_at_1
> AddButtonStyle 3 ActiveDownToggled 2 70x15_at_1 30x55_at_0
>
> Or just
>
> AddButtonStyle 3 Toggled 2 70x15_at_0 30x55_at_1
> AddButtonStyle 3 Toggled 2 70x15_at_1 30x55_at_0
>
> I have tried a couple of variations using the word "Toggled" , but i
> can not get it to work. I'm guessing that this is approach is wrong?

You obviously did not try all the combinations. :-)
Actually, guessing is not needed here if you know the keyword:

  % man fvwm2
  /Toggled

It is "ToggledActiveUp" etc. But the approach is not quite right.
Your vector drawing is also not good, you can't do it with only 2 lines.
Try this:

  Style "*" MWMButtons # button relief follows the state
  Mouse 0 3 N Stick
  ButtonStyle 3 - Clear MWMDecorStick
  ButtonStyle 3 Inactive Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1
  ButtonStyle 3 ActiveUp Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1
  ButtonStyle 3 ActiveDown Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1
  ButtonStyle 3 ToggledInactive Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1
  ButtonStyle 3 ToggledActiveUp Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1
  ButtonStyle 3 ToggledActiveDown Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1

You see that it is the same vector drawing, because sunk/raised is
automatically reversed in toggled states, so you may make it shorter:

  Style "*" MWMButtons # button relief follows the state
  Mouse 0 3 N Stick
  ButtonStyle 3 - Clear MWMDecorStick
  ButtonStyle 3 Vector 4 75x25_at_0 75x75_at_0 25x75_at_0 75x25_at_1

(You may omit the "Vector" word everywhere.)

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 Fri Jan 25 2002 - 13:05:26 GMT

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