Subject: FVWM: Apply an Style option to an existing window

From: Uwe Pross <[email-masked]>
Date: Thu, 27 Jun 2002 10:28:41 +0200

Hi there,

Is there a possibility to assign a Style option to an existing
window. Currently I use the Style command like:

Style "Speedbar" CirculateSkip

I would like to get a menu entry to assign a property like
CirculateSkip to a window which already exists.
Like 

AddToMenu WindowMenu 
+ "Skip this window when using (Alt-Tab)" Current Style CirculateSkip 

(I know the above is not correct, but I shows what I would like to have.) 

I would like to do same with other styles like Foreground, Background,
Hilight*, ...  

Any suggestions? 

Thanks in advance.

Bye Uwe
-- 
+--------------------------------------------------
| Uwe Pross 
| mail : mailto:[email-masked]
| www  : http://www.tu-chemnitz.de/~uwp
+--------------------------------------------------
--
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: Thu, 27 Jun 2002 10:05:15 +0000

> (I know the above is not correct, but I shows what I would like to have.) 

Theoretically currently you can't apply Style to only one window,
but practically you may get acceptable results. Add "$n":

  + "Skip this window when using (Alt-Tab)" Current Style $n CirculateSkip

Or replace "Current" with "Pick (CirculateHit)" if this is what you want.

> I would like to do same with other styles like Foreground, Background,

Please use colorsets instead. Then you just change colorset dynamically
without a need to change any Style.

Regards,
Mikhael.

---

From: Uwe Pross <[email-masked]>
Date: Thu, 27 Jun 2002 13:11:49 +0200

>   + "Skip this window when using (Alt-Tab)" Current Style $n CirculateSkip

Thanks. The lines.

DestroyMenu windowops
AddToMenu windowops "Window menu"     Title
 -------------------------------<snip>-------------------------------
 + "Enable  (Alt-Tab)%mini.keyboard.xpm%" Current Style $n CirculateHit
 + "Disable (Alt-Tab)%mini.keyboard.xpm%" Current Style $n CirculateSkip
 -------------------------------<snip>------------------------------- 

do what I want. I will see how it  goes  if  there  are  more  windows
having  the  same  name. But for the moment it does exactly what I was
looking for. 
 
Thanks for the hint.

> without a need to change any Style.

I use colorsets. The problem with colorsets is that you need to define
them  before  you can use them. For example if you want one particular
window to appear in red color and  another  one  to  appear  in  green
colorsets  might be not that suitable, since you need one colorset for
each color you want to use. 

Uwe

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 27 Jun 2002 15:12:27 +0000

> each color you want to use.

I see. Still I don't think colorsets are less suitable here than
ForeColor, BackColor and HilightFore, HilightBack.

For each color you want to use for windows (green, red) define 2 colorsets
for inactive and active window once. Then just switch window colorsets:

  # define 3 color schemes, red, green, blue
  Colorset 50 fg black, bg rgb:d0/00/00, hi rgb:ff/00/00, sh rgb:a0/00/00
  Colorset 51 fg white, bg rgb:00/60/00, hi rgb:00/30/00, sh rgb:a0/90/00
  Colorset 52 fg white, bg rgb:00/00/40, hi rgb:00/00/20, sh rgb:a0/00/80

  AddToMenu windowops
  + "Use red color scheme"   Style $n Colorset 50, HilightColorset 60
  + "Use green color scheme" Style $n Colorset 51, HilightColorset 61
  + "Use blue color scheme"  Style $n Colorset 52, HilightColorset 62

Then you may even add something like this if you really want:

  + "Make red color scheme lighter" Func1ChangingColorsets50And60
  + "Make red color scheme darker"  Func2ChangingColorsets50And60
  + "Make red color scheme more cyan" ... :-)

This changes colors of all windows that currently use red color scheme.
For versions < 2.4.8 the syntax is "*FvwmTheme: Colorset ..." of course.

Regards,
Mikhael.

---

From: Uwe Pross <[email-masked]>
Date: Fri, 28 Jun 2002 07:58:12 +0200

>   + "Make red color scheme more cyan" ... :-)

Sounds reasonable. 

One question is left: How would this Colorset change function look
like? (fvwm 2.5.1)

Uwe

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 28 Jun 2002 09:08:20 +0000

> One question is left: How would this Colorset change function look

Currently you may just setup new constant colors:

  AddToFunc SetupDarkerRedColors
  + I Colorset 50 bg rgb:60/00/00, fg contrast  # inactive
  + I Colorset 60 bg rgb:a0/40/40, fg contrast  # active

It is planned (but not finally) to add TintBg colorset option that makes
this automatically, i.e. make colorset bg lighter, darker, more bluish.
I would wait until the new colorset option names (including the current
Tint that works on pixmaps) are finalized.

Regards,
Mikhael.

---

From: Uwe Pross <[email-masked]>
Date: Fri, 28 Jun 2002 11:23:42 +0200

>   + I Colorset 60 bg rgb:a0/40/40, fg contrast  # active

I thought so.

> Tint that works on pixmaps) are finalized.

Sounds great. I think this would be a nice feature.

Bye Uwe