Subject: FVWM: UseStyle

From: Dan Niles <[email-masked]>
Date: Wed, 1 May 1996 14:33:20 -0500

I am trying to set up some generic styles so I can use UseStyle for
many windows.  It seems to work except for Color.

For example:

Style "Highlight"      Color Black/Red

Style "Window"          UseStyle Highlight

Window will come out with color Black/gray, even though I don't use 
Black/Gray anywhere.  If I change it to:

Style "Window"          Color Black/Red

it works fine.  I believe there is a bug (or undocumented feature) in
UseStyle.

Dan Niles
[email-masked]
--
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: Mark Borges <[email-masked]>
Date: 01 May 1996 13:47:10 -0600

>> On Wed, 1 May 1996 14:33:20 -0500,
>> Dan Niles(d) wrote:
d> I am trying to set up some generic styles so I can use UseStyle for
d> many windows.  It seems to work except for Color.

d> For example:

d> Style "Highlight"      Color Black/Red

d> Style "Window"          UseStyle Highlight

d> Window will come out with color Black/gray, even though I don't use 
d> Black/Gray anywhere.  If I change it to:

d> Style "Window"          Color Black/Red

d> it works fine.  I believe there is a bug (or undocumented feature) in
d> UseStyle.

If it's broke, ditch it. I'm curious -- does UseStyle provide any new
functionality that isn't already provided by FvwmCPP/FvwmM4? Seems like

#define HIGHLIGHT "Color Black/Red"
Style "Window" HIGHLIGHT

would be effectively the same. And it's more powerful, since you can
customize the setting based on the display, e.g.,

/* Window and icon fonts */

#if Y_RESOLUTION >= 3700
#define WINDOWFONT	-adobe-times-bold-r-*-*-18-*-*-*-*-*-*-*
#define ICONFONT	-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
#else
#define WINDOWFONT	-adobe-times-bold-r-*-*-16-*-*-*-*-*-*-*
#define ICONFONT	-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
#endif

WindowFont	WINDOWFONT
IconFont	ICONFONT

Comments?

-- 
  -mb-

---

From: [email-masked] (Todd Fries)
Date: Wed, 8 May 1996 07:55:10 -0500 (CDT)

> d> many windows.  It seems to work except for Color.
[...]

> Comments?

Sure.  I was the person who submitted the UseStyle patch.  I thought
that I had a good idea when I searched for the style structure with
the same name as the style we wanted to mimic....

 nptr = Scr.TheList;
 while(nptr && mystrncasecmp(restofline,nptr->name,len) )
   nptr = nptr->next;
 if (nptr&& !mystrncasecmp(restofline,nptr->name,len))
 {
   on_flags      = nptr->on_flags;
   off_flags     = nptr->off_flags;
   icon_name     = nptr->value;
[...]

It looks like, to me, that the structure is copied entirely..
Being my 'initiate' patch to fvwm, I would more than bet there
are things wrong with it...

Perhaps should the char*'s be strdup'ed? .. of course!
doit!  I guess this should be fixed...sorry if these have
caused any problems...

564c564
<               icon_name     = strdup(nptr->value);
---
>               icon_name     = nptr->value;
568,569c568,569
<               forecolor     = strdup(nptr->ForeColor);
<               backcolor     = strdup(nptr->BackColor);
---
>               forecolor     = nptr->ForeColor;
>               backcolor     = nptr->BackColor = backcolor;

See if this helps things out abit...

Also, to address the question at hand...does m4/cpp preprocessing
already provide the same functionality as UseStyle.

To some degree.  However, you can't use an m4 macro in FvwmTalk,
and an m4 macro isn't quite the same as copying the binary
contents of a structure.  An m4 macro couldn't do, for
example:

Style "a" Color Black/Red
Style "b" UseStyle a
Style "a" NoTitle

To jump the fence, so to speak....however....UseStyle was
originally intended to be 'macro-like' and what better way
to do something 'like' a macro than to use a macro itself?

What does anybody else think?
-- 
Todd Fries

---

From: Andrew Veliath <[email-masked]>
Date: Wed, 8 May 1996 14:38:47 -0400

Todd> Style "a" Color Black/Red Style "b" UseStyle a Style "a"
    Todd> NoTitle

I think UseStyle is useful, but it must accept quoted styles (I am
remembering that it didn't, but maybe I was doing something wrong).
If I have a style Style "The Window"  I should be able to UseStyle
"The Window".

But I think it is pretty useful, especially for people who don't use
macro preprocessors (I use m4 extensively though).  However, if there
are any problems, IMHO, I'd rather see them addressed than not.

Andrew Veliath <[email-masked]>
http://www.rpi.edu/~veliaa
Finger for PGP Key
--
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: <[email-masked]> (Charles Hines)
Date: Wed, 8 May 1996 15:26:27 -0400

>>>>> "AV" == Andrew Veliath <[email-masked]> writes:

AV> I think UseStyle is useful, but it must accept quoted styles (I am
AV> remembering that it didn't, but maybe I was doing something wrong).
AV> If I have a style Style "The Window"  I should be able to UseStyle
AV> "The Window".

AV> But I think it is pretty useful, especially for people who don't use
AV> macro preprocessors (I use m4 extensively though).  However, if there
AV> are any problems, IMHO, I'd rather see them addressed than not.

I do plan to fix this for the next beta.

Chuck

---

From: Peter Funk <[email-masked]>
Date: Fri, 10 May 1996 09:04:27 +0200 (MESZ)

Todd Fries:
[...]
tf> Also, to address the question at hand...does m4/cpp preprocessing
tf> already provide the same functionality as UseStyle.
tf> 
tf> To some degree.  However, you can't use an m4 macro in FvwmTalk,
tf> and an m4 macro isn't quite the same as copying the binary
tf> contents of a structure.  An m4 macro couldn't do, for
tf> example:
tf> 
tf> Style "a" Color Black/Red
tf> Style "b" UseStyle a
tf> Style "a" NoTitle
tf> 
tf> To jump the fence, so to speak....however....UseStyle was
tf> originally intended to be 'macro-like' and what better way
tf> to do something 'like' a macro than to use a macro itself?
tf> 
tf> What does anybody else think?

The 'UseStyle' you invented provides the concept of "inheritance",
something which can't be accomplished by a macro.  For example:

 Style "MyDefaults" Color Black/White, Title, Icon unknown.xpm, HandleWidth 3
 Style "b"          UseStyle MyDefaults, Color White/Blue
 Style "c"          UseStyle MyDefaults, Icon foobar.xpm
 Style "MySticky"   UseStyle MyDefaults, Sticky, NoTitle, HandleWidth 1

Regards, Peter
--
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany
office: +49 421 2041925 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
--
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].