Re: FVWM: Changing Button Colors in FVWM2

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Mon, 10 Dec 2001 13:27:32 +0000

On 10 Dec 2001 13:15:30 +0100, Bernhard Schneck wrote:
>
> 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).

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.
--
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 Mon Dec 10 2001 - 07:28:58 GMT

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