Subject: Re: FVWM: Changing Decor in a Function

From: [email-masked] (Martin Cartwright)
Date: Mon, 20 Jan 1997 10:41:08 GMT

=> From: lar3ry gensch <[email-masked]>
=> Subject: Re: FVWM: Changing Decor in a Function
=> 
=> Martin Cartwright wrote:
=> > 
=> > if STICKY:
=> >         Stick
=> >         ChangeDecor "Default"
=> > else
=> >         Stick
=> >         ChangeDecor "stickydecor"
=> > endif
=> 
=> Add these lines to your .fvwm2rc file:
=> 
=> #########################################################
=> DestroyFunc	SwitchDecor
=> AddToFunc	SwitchDecor
=> + "I"	StickyDecor
=> 
=> DestroyFunc	StickyDecor
=> AddToFunc	StickyDecor
=> + "I"	ChangeDecor	"Sticky"
=> + "I"	DestroyFunc	SwitchDecor
=> + "I"	AddToFunct	SwitchDecor "I" DefaultDecor
=> 
=> DestroyFunc	DefaultDecor
=> AddToFun	DefaultDecor
=> + "I"	ChangeDecor	"Default"
=> + "I"	DestroyFunc	SwitchDecor
=> + "I"	AddToFunct	SwitchDecor "I" StickyDecor
=> 
=> ChangeDecor	"Default"
=> #########################################################
=> 
=> When you want to toggle from one to another, just execute SwitchDecor.
=> 
=> -- 
Okay, I added that in and it works just fine. I have to be careful which 
windows I use it on though as I have a different decor for xterms so that 
if I use this function, they'll revert to Default decor instead of xterm
decor... Can anyone think of a way around this?  

Also what does that last ChangeDecor "Default" do?

[email-masked] - http://star.pst.qub.ac.uk/~imc/vom.htm
-/-----------------------------------------------------------\-
|   "One sweet buzz can make you feel how I feel,             |
|    One sweet love can make a mountain slide up the hill"    |
-\-----------------------------------------------------------/-

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: lar3ry gensch <[email-masked]>
Date: Mon, 20 Jan 1997 08:56:19 -0500

> Also what does that last ChangeDecor "Default" do?

It sets up the initial "state" -- actually, since "default" is the
default state, it's not really needed.

On the subject of decors, I've come up with functions that will provide
a MWM- type and Win95- type windows (including redefining how the mouse
will work on each button).

My only real experience with mwm was in the early 1.0 phase, so somebody
may have a better "look" (mostly colors) for how my Mwm style works.

I've MIME-attached my .fvwm-decors file (which is read by my .fvwm2rc
file).
I've already sent my win95-*.xpm files to this list.  Maybe one day I'll
get around to putting this stuff on a web site, but don't hold your
breath...!

-- 
(void) lar3ry();                                      [email-masked]

     "Sometimes it happens.  People just explode.  Natural causes."
##########################################################################
# FVWM Look and Feel Code (Mostly Decors)
#========================================================================#
# 

##########################################################################
# Function:	Disable ALL buttons 
#		(This needs to be called when resetting between Win95's
#		4-button title bar to MWM's 3-button title bar)
#========================================================================#

DestroyFunc	"RemoveAllButtons"
AddToFunc	"RemoveAllButtons"
+ "I"	Style "*"	NoButton 0, NoButton 1, NoButton 2, NoButton 3, \
			NoButton 4, NoButton 5, NoButton 6, NoButton 7, \
			NoButton 8, NoButton 9

##########################################################################
# Function:	Replace "placeholder"
#		(You will need this function if you haven't made the
#		patch to add the "Replace" builtin into fvwm-2.0.44 --
#		Simply uncomment the three lines below)
#========================================================================#

#DestroyFunc	"Replace"
#AddToFunc	"Replace"	Nop
#+ "I"	Nop

##########################################################################
# Win95 Look and Feel
#========================================================================#

DestroyDecor	Win95
AddToDecor	Win95
+	TitleStyle	LeftJustified ActiveUp (Solid Navy -- flat) \
			ActiveDown (Solid Navy -- flat) \
			Inactive (Solid grey51 -- flat)
+	ButtonStyle 1	MiniIcon -- UseTitleStyle flat
+	ButtonStyle 2	Pixmap win95-close-full.xpm -- UseTitleStyle flat
+	ButtonStyle 4	Pixmap win95-maximize-full.xpm -- UseTitleStyle flat
+	ButtonStyle 6	Pixmap win95-minimize-full.xpm -- UseTitleStyle flat
+	BorderStyle	Active -- HiddenHandles NoInset
+	BorderStyle	Inactive -- HiddenHandles NoInset
+	WindowFont	-adobe-helvetica-bold-r-*-120-*
+	HilightColor	white grey60

DestroyFunc	DecorWin95
AddToFunc	DecorWin95
+ "I"	RemoveAllButtons
+ "I"	Style "*"	UseDecor Win95, ForeColor Black
+ "I"	Style "*"	Button 1, Button 2, Button 4, Button 6
+ "I"	MenuStyle	Black grey75 grey40 -adobe-helvetica-medium-r-*-120-* mwm
+ "I"	Mouse 0	1 N	Menu Window-Ops Close
+ "I"	Mouse 0	2 N	Close
+ "I"	Mouse 0	4 N	Maximize
+ "I"	Mouse 0	6 N	Iconify
+ "I"	Mouse 3	6 N	Replace

AddToFunc	DecorWin95
+ "I"	Exec		xsetroot -solid cyan4
+ "I"	Recapture

#=========
# mwm
#=========

DestroyDecor	Mwm
AddToDecor	Mwm
+	TitleStyle	Centered
+	TitleStyle	ActiveUp (Solid cyan4 -- Raised) \
			ActiveDown (Solid cyan4 -- flat) \
			Inactive (Solid grey51 -- Raised)
+	ButtonStyle	Reset
+	ButtonStyle	All -- UseTitleStyle
+	ButtonStyle 2	5  25x25@1 25x75@1 75x75@0 75x25@0 25x25@1
+	ButtonStyle 4	5  45x45@1 55x45@1 55x55@0 45x55@0 45x45@1
+	WindowFont	-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*
+	HilightColor	white cyan4

DestroyFunc	DecorMwm
AddToFunc	DecorMwm
+ "I"	RemoveAllButtons
+ "I"	Style "*"	UseDecor Mwm, ForeColor Black
+ "I"	Style "*"	Button 1, Button 2, Button 4
+ "I"	MenuStyle	Black grey75 grey40 -adobe-helvetica-medium-r-*-120-* mwm
+ "I"	Exec		xsetroot -solid grey
+ "I"	Recapture
+ "I"	Mouse 0	1 N	Menu Window-Ops Close
+ "I"	Mouse 0	2 N	Maximize
+ "I"	Mouse 0	4 N	Iconify
+ "I"	Mouse 3	4 N	Replace

DestroyMenu	DecorMenu
AddToMenu	DecorMenu
+	"Decors"	Title
+	"MWM"		DecorMwm
+	"Win95"		DecorWin95