home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!snorkelwacker.mit.edu!bloom-beacon!INTERNET!dont-send-mail-to-path-lines
- From: da188@city.ac.UK
- Subject: Re: X Resources
- Message-ID: <AA28652.9207301045.Euston@uk.ac.city>
- Sender: daemon@athena.mit.edu (Mr Background)
- Reply-To: da188@city.ac.uk
- Organization: The Internet
- Date: Thu, 30 Jul 1992 10:45:51 GMT
- Lines: 45
-
- >Could someone give be a brief explanation of resources.
- >
- >Specifically, I don't understand why some resources use a '*' and other
- >use '.' as separator characters.
-
- Basically, a line in a resource file specifies the pathname to a particular
- widget who's resource you want to set. Imagine the widgets as a tree structure
- and it becomes easier to understand. So for example, if I wrote an X program
- which used a Command widget, inside a box Form widget, which in turn is
- managed by the top level Shell I might have the following:
-
- topLevel.form.button.label : hi
-
- The last element in the 'pathname' above is the resource. To save you having to
- have to know the exact hierarchy of the widgets and to allow for future changes
- I could put 'wildcards' in (similar to using the * character in a unix shell
- command line) between the widgets, and in fact cut out the middle bit of the
- path entirely:
-
- topLevel*button.label : hi
-
- Thus if new widgets are introduced in a future application release, your
- resources would still be useable (assuming the widgets have the same names!)
- You could even make this more loosely bound and have all label resources in ALL
- clients set to hi thus:
-
- *.label: hi
-
- Though this is a slightly extreme example. The choice between using completely
- . separated pathnames and * separated ones is yours - looser bindings are
- generally better however.
-
- >Secondly, is the format for .Xresources and .Xdefaults files the same?
-
- I use an .Xdefaults file in my home directory, I assume .Xresources is similar.
-
-
- Aj.
- --
- .----------------------------[ The Eno ]----------------------------------.
- | "The trouble with New Age | JANET : da188@uk.ac.city |
- | music is that there's no | da188@uk.ac.city.cs |
- | evil in it." | I-NET : da188@city.ac.uk |
- | - Brian Eno | US : da188%city.ac.uk@cunyvm.cuny.edu |
- `-------------------------------------------------------------------------'
-