Some difficulties with State

Hello there, i have some difficulties for using the State Command.

Here my problem : i have a window called “Side” and i want change her colorset.
So i want that : State 7 True = Side transparent and State 7 False = side not transparent.

[code]DestroyFunc SideTransparent
AddToFunc SideTransparent

  • I Test (State 7) Colorset 20 fg white, RootTransparent buffer, Tint #414b54 85
  • I TestRc (Match) State 7 True
  • I Test (!State 7) Colorset 20 fg white, Pixmap cinza/hilite-side.png
  • I TestRc (Match) State 7 False
  • I UpdateStyles
    [/code]
    But when i call SideTransparent, it does nothing while if i change the colorset directly in the FvwmConsole, it works. Any ideas ?

Try exchanging the “State 7 True” and “State 7 False”… the first Test will match when State 7 is turned on, so you want to turn it off afterwards.

Currently the function will always match on “Test (!State 7)” and ensure that it stays turned off…

HTH
Friedel

It might also be out of context – i.e. you mean to use:

+ I ThisWindow (State n) .....

Also, no need for “UpdateStyles” — none are applied in this function.

– Thomas Adam