[comp.windows.x] App Defaults shouldn't look for program name

gaf@uucs1.UUCP (gaf) (07/18/89)

This posting comes after an eleventh hour bout with a group of demo programs. 
We had developed them on one machine, and then moved them to the demo machine. 
The time between progam invocation and the appearance of the window on the
screen was *much* longer on the demo machine than on the development machine -
too long to explain away in a demo. 

Well, between a debugger and the source listings it turns out that one place
Xt looks for application defaults is in the user's home directory under the
same name as the program (actually, whatever class was given on the initial
shell creation).  So what was happening was that on the demo machine, the demo
user's home directory was the same place the executables lived, and Xt was
reading the executable to look for defaults (fgets on 800K!).

After discovering this, I reread the Xt Intrinsics section on app defaults
and, yes, it was mentioned there after all.  Before you say RTFM, though, I'd
like to request that the X powers-that-be make this stand out *much* better
than it does now in the manual (I would not have inferred the problem from the
manual), or else change the way Xt works.  Maybe look for "program.rc" instead
of just "program".  Something!  This is a time bomb that went off in our faces
and will probably hurt someone else some day. 

-- 
Guy Finney					It's that feeling of deja-vu
UUCS inc.   Phoenix, Az				all over again.
ncar!noao!asuvax!hrc!uucs1!gaf	sun!sunburn!gtx!uucs1!gaf

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (07/18/89)

> Well, between a debugger and the source listings it turns out that one place
> Xt looks for application defaults is in the user's home directory under the
> same name as the program (actually, whatever class was given on the initial
> shell creation).

There is an important difference between the application name and the class.
The name is a specific instance of an application, while the class refers to
all possible invocations of the application (The distinction is important for
resource loading).  Thus it is important that the name a class of the
application be different.  Here is the convention that we use on most of
our applications. In general we use a class name for the application that is the
same as the application name, BUT the first letter is capitalized.

Thus:

	Name		Class
--------------------------------
	xman		Xman
  	xedit		Xedit

Using this convention should keep this from biting you.  Of course, if you have
a system that ignores case then you can still lose with this system.

> Before you say RTFM, though, I'd like to request that the X powers-that-be
> make this stand out *much* better than it does now in the manual.

Our "manual" is really the Xt intrinsics specification.  I agree that this is
pretty dense stuff and it is easy to overlook minor points that may bite you.
My hope is that as more people write books on learning Xt this type of thing
will become less of a problem.

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213

stevep@stellar.stellar.COM (Steve Pitschke) (07/19/89)

>> There is an important difference between the application name and the class.
>> The name is a specific instance of an application, while the class refers to
>> all possible invocations of the application (The distinction is important fo
r
>> resource loading).  Thus it is important that the name a class of the
>> application be different.  Here is the convention that we use on most of
>> our applications. In general we use a class name for the application that is
 the
>> same as the application name, BUT the first letter is capitalized.

>> Thus:

>> 	Name		Class
>> --------------------------------
>> 	xman		Xman
>>   	xedit		Xedit

Actually, the Athena widget documentation has a slightly different
convention.

	By convention, the class name is formed by reversing the
	case of the applications first significant letter.  For example,
	an application name "xterm" would have a class name of
	"XTerm".

I wish that we would all (all us happy X users) arrive on a convention
that is the same one.  The capitolization issue, only the "x", everything
up to the first significant character ("xt") has puzzled our users
no end.  I realize this is only a conventions, but consistent statements
about it would be appreciated.

envbvs@epb2.lbl.gov (Brian V. Smith) (07/19/89)

In article <8907181551.AA10891@expo.lcs.mit.edu>, kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) writes:

< There is an important difference between the application name and the class.
< The name is a specific instance of an application, while the class refers to
< all possible invocations of the application (The distinction is important for
< resource loading).  Thus it is important that the name a class of the
< application be different.  Here is the convention that we use on most of
< our applications. In general we use a class name for the application that is the
< same as the application name, BUT the first letter is capitalized.
< 
< Thus:
< 
< 	Name		Class
< --------------------------------
< 	xman		Xman
<   	xedit		Xedit
< 

I thought the convention was to capitalize the first TWO letters of the name 
to signify the class when it comes to application default files.
e.g. one of the files that is used for an xterm client is /usr/lib/X11/app-defaults/XTerm

Why is one capital letter used for the class name and two for the default file?
_____________________________________
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory

gaf@uucs1.UUCP (gaf) (07/20/89)

In article <8907181551.AA10891@expo.lcs.mit.edu> kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) writes:

>Our "manual" is really the Xt intrinsics specification.  I agree that this is
>pretty dense stuff and it is easy to overlook minor points that may bite you.
>My hope is that as more people write books on learning Xt this type of thing
>will become less of a problem.
>

Perhaps what's needed is something like a "style guide" for Xt
(& Athena widgets).
-- 
Guy Finney					It's that feeling of deja-vu
UUCS inc.   Phoenix, Az				all over again.
ncar!noao!asuvax!hrc!uucs1!gaf	sun!sunburn!gtx!uucs1!gaf