| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 476.1 | Try "geometry" | STAR::BECK | 2B or D4 - that is the question | Fri Mar 24 1989 18:14 | 6 | 
|  |     I believe you need to use the "geometry" setting, a la
    
Clock.geometry:			135x95+1-1
    
    which goes in DECW$CLOCK.DAT.
 | 
| 476.2 | DECW$XDEFAULTS.DAT or DECW$CLOCK.DAT | OIWS20::BRYSON |  | Fri Mar 24 1989 18:54 | 7 | 
|  |     The geometry setting may be placed in SYS$LOGIN:DECW$XDEFAULTS.DAT or
    SYS$LOGIN:DECW$CLOCK.DAT for only a single account's customization, or
    in DECW$SYSTEM_DEFAULTS:DECW$CLOCK.DAT for a system-wide customization
    of Clock.
    
    David
 | 
| 476.3 | How can I make the changes take? | 36191::NEWMAN | What, me worry? YOU BET! | Wed May 24 1989 15:34 | 8 | 
|  |     I have another question regarding DECW$XDEFAULTS.DAT
    
    Once I am logged into my system and I make edits to DECW$XDEFAULTS.DAT,
    how can I make the changes take place other than logging out and back
    in again.
    
    Thanks
 | 
| 476.4 |  | STAR::MFOLEY | Rebel without a Clue | Wed May 24 1989 16:24 | 9 | 
|  | 
	DIR/ALL/AUTHOR=PORTER  or DIR SMAUG::DAVES_BITSHOP:
	You should find something written by Dave Porter that will
	do this for you...
							mike
 | 
| 476.5 |  | 2199::VANNOY | Jake VanNoy | Thu May 25 1989 10:58 | 9 | 
|  | >    Once I am logged into my system and I make edits to DECW$XDEFAULTS.DAT,
>    how can I make the changes take place other than logging out and back
>    in again.
    
Pick "Used Last Saved Settings" in the session manager.  Any application
starting up after that will use the new resource database.
 | 
| 476.6 |  | 38863::DERAMO | Daniel V. {AITG,ZFC}:: D'Eramo | Thu May 25 1989 18:33 | 6 | 
|  | 	re .4:  That's SMAUG::DAVES_BITSHOP:RELOAD.C and RELOAD.EXE.
	I had to increase the constant MAXLEN before I could use it,
	because my defaults file was too long.
	Dan
 | 
| 476.7 | why is the sky blue, daddy? | NEURON::NICHOLSON | A belly as big as an oil spill | Tue Jun 06 1989 18:36 | 51 | 
|  |     In looking at DECW$XDEFAULTS files that have been posted in this
    conference, I had come to the misguided conclusion that an exclamation
    point served as a comment character when placed in front of a line
    in a resource file.
    
    Today I "commented" out a line in my DECW$XDEFAULTS file and after
    logging out and back in (I didn't realize that you could use the
    method .5 suggests - thanks .5) I had a different color background
    for my DECterm windows.  The line I commented out had nothing to
    do with DECterm resources (it was "Notes*mumble...").  If I removed
    the "comment" character and logged out and in again, DECterm windows
    went back to the way they were before.
    
    It had something to do with the fact that in my DECW$XDEFAULTS.DAT file
    I have a line "*background: some-color" and from DECW$SM_COLOR.DAT it
    picks up the line "*Background: some-other-color".  Always before, by
    DECterm windows were the color from the specific resource "*background"
    instead of the class resource "*Background".  Adding an exclamation
    point to an unrelated line had the side effect of causing DECterm to
    use the class resource for some reason. 
    I'm not really concerned about this specific problem (removing a
    bunch of other lines with ! in front of them cleared it up!) but
    I was wondering how many other people might assume that an ! is
    a comment character to Xrm and get bit and also I was wondering
    whether there should be a comment character that would cause a line
    in a resource file NOT to get loaded.
    Comments?
    
    Also, in playing with geometry I noticed that if I had lines like
    
    	mumble.x:	-20
    	mumble.y:	-20
    
    it would position mumble's window 20 pixels to the left of 0,0 and
    would override the y value (the window manager not wanting the title
    bar off the screen).
    
    If I used something like
    
    	mumble.geometry:	400x300-20-20
    
    however, it would position the window offset -20 in both the x and
    y direction from the bottom right hand corner.
    I can live with this - is this how it's supposed to work?
    
    Thanks,
    Mark
 | 
| 476.8 |  | MU::PORTER | we have seen the enemy and it is us | Wed Jun 07 1989 09:14 | 4 | 
|  | I believe that # functions as a comment character.   At least,
lines in DECW$XDEFAULTS that begin with `#' don't appear to get
stored on the root window.
 | 
| 476.9 | ! is comment, # is a control line | MIPSBX::thomas | The Code Warrior | Wed Jun 07 1989 12:02 | 8 | 
|  | ! as in
#ifdef COLOR
Mail*foreground:	purple
#endif
#ifndef COLOR
Mail*background:	black
#endif
 | 
| 476.10 | hope we get to the bottom of this | NEURON::NICHOLSON | A belly as big as an oil spill | Wed Jun 07 1989 14:47 | 19 | 
|  |     re: .8
    Thanks, that's right.
    
    I thought about the # character, but when I looked at what
    was in the RESOURCE_MANAGER property (which gets loaded using the
    Xrm routines) I saw the "#augment \n\" lines so I didn't think the
    # was it.  Those lines, however, are continuations of other lines,
    so # does in deed act as a comment character if it appears at the
    beginning of a line.
re: .9
    
    In looking at the source code for XrmGetFileDatabase (which is what
    gets used to read resource files into Xrm databases), it calls
    PutLineResources which skips lines that start with a #, but treats
    lines that start with an ! just like any other line.  So, unless
    I'm missing something, ! is not a comment, but # is.
 | 
| 476.11 |  | MU::PORTER | we have seen the enemy and it is us | Wed Jun 07 1989 18:41 | 13 | 
|  |     I base my statement on that "# is a comment, and ! is not" on
    the observation that the stored resource string (property 
    XA_RESOURCE_MANAGER on the root window) contains lines from
    my DECW$XDEFAULTS that start with a shriek, and doesn't contain
    lines that start with a hash.
    
    Now, maybe the hash really serves as an introducer for some
    kind of directive, and bogus directives are quietly dropped -- 
    I dunno about that.  
    
    (This under VMS, by the way).
    
 | 
| 476.12 | #=comment, | DECWIN::JACKIE | Jackie Ferguson | Thu Jun 08 1989 07:54 | 10 | 
|  | Dave is correct, # is the comment character.
Lines that begin with ! might be ignored, they might cause strange results,
just like any illegal resource name.  
This will be documented in the xrm chapter of the guide to xlib programming
which will be out with the next release.
Jackie
 | 
| 476.13 | DECW$XDEFAULTS.DAT documented anywhere? | 5063::HARROW | Jeff - The Network *IS* the System! | Thu Jun 08 1989 09:01 | 5 | 
|  | Is there currently any documentation for the DECW$XDEFAULTS.DAT file contents?
Jeff
	
 | 
| 476.14 |  | LESLIE::LESLIE | Andy ��� Leslie | Thu Jun 08 1989 09:07 | 2 | 
|  |     Nope.
 | 
| 476.16 |  | FLUME::dike |  | Thu Jun 08 1989 11:14 | 4 | 
|  | I don't know about VMS, but Ultrix uses '#' in .Xdefaults files for cpp
directives and '!' for comments.
				Jeff
 | 
| 476.17 |  | DECWIN::FISHER | Burns Fisher 381-1466, ZKO3-4/W23 | Thu Jun 08 1989 11:37 | 6 | 
|  | I thought we had the same xrm in Ultrix and VMS.  Who is running this whole
thing through cpp?  Not that it is not a good idea to have some control
lines, but we should also have some consistency.
Burns
 | 
| 476.18 | UWS Programming, Volume 3, XUI Intrinsics, Appendix A | MIPSBX::thomas | The Code Warrior | Thu Jun 08 1989 15:11 | 17 | 
|  | A resource file contains text represnting the default resource values for
an application or set of applications.  The resource file in an ASCII text
file that consists of a number of lines with following EBNF syntax:
resourcefile	= {line "\n"}.
line		= (comment | production).
comment		= "!" string.
production	= resourcename ":" string.
resourcename	= ["*"] name {("." | "*") name}.
string		= { <any character not including eol> }.
name		= {"A" - "Z" | "a" - "z" | "0" - "9"}.
If the last character on a line is a backslash (\), that line is assumed to
continue on the next line.
To include a newline character in a string, use "\n".
 | 
| 476.19 |  | FLUME::dike |  | Thu Jun 08 1989 16:14 | 5 | 
|  | Xrm never sees #'s, or it ignores them if it sees them.  xrdb is the
guy who runs your resources though cpp, after feeling your server
and defining (or undefining) things like COLOR.
				Jeff
 | 
| 476.20 | !'s seem to work better than #'s | AGBEAR::HORNER | A.G.Bear, Low tech teddy bear | Fri Jun 09 1989 07:01 | 10 | 
|  |     I'm not sure if all this applies to VMS or Ultrix or both, but I tried
    changing the !'s that I had been using at the beginning of comment lines
    to #'s to see if this would eliminate some strange behavior that I've
    had in the past.  My VMS xdefaults file seemed to be sensitive to the
    ordering of some of the comment lines, and I thought this might be
    the solution.  To sum it all up, the #'s were a disaster, and I'm back
    to !'s.
              Dave
 | 
| 476.21 | but then reality got in the way | NEURON::NICHOLSON | A belly as big as an oil spill | Fri Jun 09 1989 13:17 | 11 | 
|  |     re: .20
    
    however, reality is that a # in front of a line causes Xrm to treat
    it as a comment (i.e. throw it away) unless the line is a continuation
    line and a ! does nothing but give you a resource that you'll probably
    never match (and possible nasty side effects).
    
    Can you explain how the # were a disaster?
    
    Mark
 | 
| 476.22 | It seemed to confuse session manager | AGBEAR::HORNER | A.G.Bear, Low tech teddy bear | Fri Jun 09 1989 13:58 | 12 | 
|  |     Re: -.1
    When I put #'s in my xdefaults file, logged out, and logged back in,
    session manager apparently didn't read (or use?) anything out of the
    SM_COLOR and SM_GENERAL files.  I lost every piece of customization
    that is done through session manager and got a default vanilla system.
    I deleted the # version of the xdefaults file, logged out, logged back
    in, and session manager customization was back.  I didn't pursue it
    any further after that.
                Dave
 | 
| 476.23 | Most applications use ! | SEAN::DAVIDSON |  | Fri Jun 09 1989 14:39 | 10 | 
|  | re: .21
I don't know about Ultrix but on VMS all but one application I've found uses
the ! as a comment line in their default files in SYS$LIBRARY:.  That includes
the session manager .DAT file.  It would be nice if this could be agreed upon
so that it would be uniform for everyone.
Sean
 | 
| 476.24 | ? | HANNAH::MESSENGER | Bob Messenger | Mon Jun 12 1989 18:03 | 11 | 
|  | Re: .23
>I don't know about Ultrix but on VMS all but one application I've found uses
>the ! as a comment line in their default files in SYS$LIBRARY:. 
What's the one application, and how does an application "use" the ! as a
comment line?  Do you mean that all but one application ignore resources
that start with !?
				-- Bob
 | 
| 476.25 |  | MU::PORTER | l'enregistrement electrique | Mon Jun 12 1989 20:15 | 15 | 
|  |     What he means is this:  many DECwindows developers believe that
    "!" is a comment symbol, because many of the DECW$foo.DAT files
    supplied by DECwindows contain lines which start with "!".
    
    (Actually, I don't suppose there's any guarantee that DECW$foo.DAT
     files use the same convention as DECW$XDEFAULTS.DAT, so this could
     be false logic!).
    
    Looks like this mess needs to be sorted out.
    
    Presumably, the 'correct' comment symbol in Xdefaults is 
    defined by the Xlib specification, and so all we have to
    do is read the spec, make the code follow suit, and then
    promulgate the information to all developers?  Right?
 | 
| 476.26 | ! looks like the de facto comment character | HANNAH::MESSENGER | Bob Messenger | Mon Jun 12 1989 20:39 | 16 | 
|  | Re: .25
Oh, that makes sense; I'd forgotten about those files.  A quick check of
sys$library on my workstation reveals that Bookreader, Calc, Calendar,
Cardfiler, Clock, Mail and Puzzle use ! for comments and Banner, Notepad,
Paint, DECterm and the Window Manager do not.  None of the decw$*.dat
files use # for comments.
The description of the resource manager on pages 324 to 339 of "X Window
System  C Library and Protocol Reference" doesn't say anything about
comment characters.  It's unlikely that any application would be so
rude as to use ! as part of a valid resource name, but it might be a good
idea to make that a formal convention.
				-- Bob
 | 
| 476.27 |  | MU::PORTER | l'enregistrement electrique | Tue Jun 13 1989 09:30 | 85 | 
|  | Well, the applications are the ones that made a mistake -- I think *they*
should change to obey the already-existing comment convention!   (Seriously,
whatever is chosen, it ought to be the same for VMS and Ultrix).
In case it's of use to anyone, here's the program I used to figure this
out: it gets the resource manager string from the root window, and looks
for lines which start with "!" or "#".   
On VMS, all "!" lines are retained (well, subject to elimination of
duplicates).  In fact, they're not only retained, they're reformatted
as resource database lines: thus "!comment" becomes "!comment:".
Conversely, all "#" lines are discarded (but only if the "#" is at the
beginning of the line -- in the session manager's "#augment" stuff, the
hash sign is in the middle of a line).
-------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <decw$include/Xlib.h>
#include <decw$include/Xutil.h>
#include <decw$include/Xatom.h>
#include <decw$include/Xresource.h>
#define XDEFAULTS "sys$login:decw$xdefaults.dat"
#define MAXLEN 4096L	/* 4K chars */
main(argc, argv)
int argc;
char *argv[];
{
    Display *dpy;
    Screen *scr;
    Window root;
    Atom ptype;
    int pform;
    unsigned long nitems, nafter;
    unsigned char *prop;
    int i;
    unsigned char *p1, *p2;
    dpy = XOpenDisplay(0);
    if (dpy==0) {
	printf("can't open display\n");
	exit(-1);
	}
    scr = XDefaultScreenOfDisplay(dpy);
    root = XRootWindowOfScreen(scr);
    XGetWindowProperty(
		      dpy, root, 
		      XA_RESOURCE_MANAGER,
		      0L, MAXLEN/4, 0, AnyPropertyType,
		      &ptype, &pform, &nitems, &nafter, &prop);
    if (ptype==None) {
	printf("property not found on root\n");
	exit(-1);
	}
    if (ptype!=XA_STRING || pform!=8) {
	printf("unexpected property data read\n");
	exit(-1);
	}
    if (nafter) {
	printf("property too big (%ld bytes)\n", nitems+nafter);
	exit(-1);
	}
    printf("size: %ld bytes\n", nitems);
    
    p1 = prop;
    while (p1<prop+nitems && *p1!='\0') {
	p2 = p1;
	while (p2<prop+nitems && *p2!='\0' && (*p2!='\n' || *(p2-1)=='\\')) p2++;
	if (*p1=='#' || *p1=='!') {
	    *p2 = '\0';
	    printf("%s\n", p1);
	    }
	p1 = p2 + 1;
	}
}
 | 
| 476.28 |  | SEAN::DAVIDSON |  | Wed Jun 14 1989 14:32 | 17 | 
|  | re:
You got it Dave.
When the first IFT DECwindows and applications came out I used the '!' as
comment lines and was promptly told by another person in my group that I should
NOT do that because that line will be created as a resource, duplicates
excluded, and slow things down a bit because now all the garbage resource names
were created.
I thought the comment line was already a standard but I guess not.  Comments
can really help out some of those cryptic resource names, for those of use who
want to hack things up.
Sean
 |