Subject: FVWM: Changing Button Colors in FVWM2

From: Bernhard Schneck <[email-masked]>
Date: Mon, 10 Dec 2001 13:15:30 +0100

Does anybody know an answer to the following problem concerning FVWM2,
version 2.4:

I have a number of desks on my physical screen and I decided to give
each desk a different background color. This works well with the
*FvwmBackerCommand statement in my .fvwm2rc file.

Now somebody in our team wants that the buttons created by FvwmButtons
have different background colors too - according to the desk, which is
currently shown on the screen. Up to now I did not succeed in changing
the button color when changing the desk. What I tried is a statement of
the following kind:

*FvwmBackerCommand (Desk <number>) *FvwmButtonsBack <color>

but it seems that FvwmBacker does not want to communicate with
FvwmButtons (at least not in the way, which I expected that it would
do).

I also tried "*FvwmButtonsColorset <colorset>" instead of
"*FvwmButtonsBack <color>", but that did not work either (although
FvwmTheme was started).

I appreciate any help.
--
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: Mon, 10 Dec 2001 13:27:32 +0000

> "*FvwmButtonsBack <color>", but that did not work either (although

A running FvwmButtons does not respond to a new configuration, you should
restart it (KillModule FvwmButtons, Module FvwmButtons) to use a new
*FvwmButtons configuration.

Instead, you want to use colorsets that are invented for these purposes.
All modules do respond to colorset changes dynamically. Use this:

  *FvwmTheme: Colorset 10 fg white, bg gray  # initial colors

  *FvwmBacker: Command (Desk 0) *FvwmTheme: Colorset 10 bg gray
  *FvwmBacker: Command (Desk 1) *FvwmTheme: Colorset 10 bg cyan

  *FvwmButtons: Colorset 10

I just noticed that FvwmBacker has a misfeature, you can't use a comma in
a command, so you should create a function if you want to change fg too:

  DestroyFunc ChangeColorsetFgBg
  AddToFunc   ChangeColorsetFgBg
  + I SendToModule FvwmTheme Colorset $0 fg $1, bg $2

  *FvwmBacker: Command (Desk 0) ChangeColorsetFgBg 10 white gray
  *FvwmBacker: Command (Desk 1) ChangeColorsetFgBg 10 red cyan

As you see, you may use both SendToModule FvwmTheme or *FvwmTheme: to
change any colorset dynamically.

Regards,
Mikhael.

---

From: Bernhard Schneck <[email-masked]>
Date: Mon, 10 Dec 2001 15:18:30 +0100

> change any colorset dynamically.

Thanks for your prompt reply to my question!

I have no problem with the comma in the FvwmBackerCommand, because I
only need to change the background color and for this purpose the
command
"*FvwmThemeColorset 10 bg <color>" is sufficient. 

I already tried your proposal and it works.

Best regards,
Bernd Schneck

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 10 Dec 2001 13:25:56 +0100

> "*FvwmButtonsBack <color>", but that did not work either (although

Modules usually don't react to configuration changes after they
have been started.  You can still get what you want with colour
sets.  Just define a colour set to be used with FvwmButtons as you
already did:

  # colour set for use with FvwmButtons
  *FvwmThemeColorset 6 fg red, bg green

and then use the SendToModule command to inform FvwmTheme and
thus FvwmButtons about the colour changes:

  *FvwmBackerCommand (Desk <number>) SendToModule FvwmTheme Colorset 6 fg blue, bg yellow

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20