[comp.windows.x] don't put class name in app-defaults file

erik@srava.sra.co.jp (Erik M. van der Poel) (02/04/90)

In my resources file I have the following line:

	*Font: foo

because I want all my clients to use my favorite font `foo'. However,
`xcalc' does not use this font because the XCalc app-defaults file
contains the following:

	XCalc*Font: *-helvetica-medium-r-normal--*-100-*-*-*-*-*-*

which is more specific than my entry, and therefore takes precedence.
(Don't take this personally, Donna. XCalc is not the only app-defaults
file that specifies the class name.)

So I have to go through the trouble of adding yet another line

	XCalc*Font: foo

to my resources file and running xrdb again, or I have to change the
app-defaults file, or whatever, but in any case, some hassle is
involved.

Now, the author of an application is of course free to force resources
upon the user (e.g. by using XtSetValues) but this is not advisable,
as several "authorities" have said.

However, in the case of app-defaults files, I feel it is not necessary
to specify the class name, because only applications of class `Blurfl'
are going to look at the app-defaults file `Blurfl' anyway.

So I propose a guideline for application programmers:

	Don't put the class name in the app-defaults file.

Any comments?

-- 
Erik M. van der Poel                  erik@sra.co.jp             (Japan)
SRA, 1-1-1 Hirakawa-cho, Chiyoda-ku   erik%sra.co.jp@uunet.uu.net  (USA)
Tokyo 102 Japan. TEL +81-3-234-2692   erik%sra.co.jp@mcvax.uucp (Europe)

meo@stiatl.UUCP (Miles O'Neal) (02/06/90)

In article <3744@srava.sra.co.jp> erik@sra.co.jp (Erik M. van der Poel) writes:
|So I propose a guideline for application programmers:
|
|	Don't put the class name in the app-defaults file.
|
|Any comments?

Sounds good to me.

-Ye Olde App Programmer

converse@EXPO.LCS.MIT.EDU (Donna Converse) (02/06/90)

> I propose a guideline for application programmers:
> 
> 	Don't put the class name in the app-defaults file.
> 
> Any comments?

I agree completely.  It also provides the user more latitude in resource
specification if the application class resource file gives resource names,
where possible, as resource class names rather than resource instance names.
e.g., better to use *Font than *font in an app-defaults file.

The bug report has been filed.  You can change all the instances of "XCalc."
to "*" and remove the remaining "XCalc"s.  Change "icon_name" to "IconName".

Donna Converse
converse@expo.lcs.mit.edu