Subject: FVWM: 2 states for a button

From: "Anders K. Lyhne Th0gersen" <[email-masked]>
Date: Fri, 25 Jan 2002 19:02:00 +0100 (CET)

Hi!

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@0 30x55@1 
AddButtonStyle 3 ActiveDownToggled 2 70x15@1 30x55@0

Or just

AddButtonStyle 3 Toggled  2 70x15@0 30x55@1
AddButtonStyle 3 Toggled 2 70x15@1 30x55@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?

Does anyone have a suggestion to how i can accomplish this?

Anders

--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 25 Jan 2002 19:04:39 +0000

> 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@0 75x75@0 25x75@0 75x25@1
  ButtonStyle 3 ActiveUp          Vector 4 75x25@0 75x75@0 25x75@0 75x25@1
  ButtonStyle 3 ActiveDown        Vector 4 75x25@0 75x75@0 25x75@0 75x25@1
  ButtonStyle 3 ToggledInactive   Vector 4 75x25@0 75x75@0 25x75@0 75x25@1
  ButtonStyle 3 ToggledActiveUp   Vector 4 75x25@0 75x75@0 25x75@0 75x25@1
  ButtonStyle 3 ToggledActiveDown Vector 4 75x25@0 75x75@0 25x75@0 75x25@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@0 75x75@0 25x75@0 75x25@1

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

Regards,
Mikhael.

---

From: "Anders K. Lyhne Th0gersen" <[email-masked]>
Date: Fri, 25 Jan 2002 20:42:33 +0100 (CET)

Hi Again!

Thanks for your help, .. it worsk fine! 

> It is "ToggledActiveUp" etc. But the approach is not quite right.

D'oh, Thought i tried 'em all... Sorry to bother you with silly
questions...

Regards 

  Anders

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 27 Jan 2002 15:19:04 +0100

> D'oh, Thought i tried 'em all... Sorry to bother you with silly

There are no silly question, only silly answers.  The fact that
people have trouble finding the necessary information indicates
that our documentation isn't good enough.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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 [email-masked].
To report problems, send mail to [email-masked].