home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / windows / x / 14465 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  5.0 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!rutgers!uwvax!astroatc!vidiot!ftms!brown
  2. From: brown@ftms.UUCP (Vidiot)
  3. Newsgroups: comp.windows.x
  4. Subject: app-defaults problem solved
  5. Message-ID: <259@ftms.UUCP>
  6. Date: 27 Jul 92 16:21:10 GMT
  7. Reply-To: brown@ftms.UUCP (Vidiot)
  8. Organization: Vidiot's Other Hangout
  9. Lines: 110
  10.  
  11.  
  12. I have received a few pieces of e-mail requesting the info I received on
  13. solving my app-defaults problem.
  14.  
  15. I have the following set in .zshenv (yes, I use zsh):
  16.  
  17. export XFILESEARCHPATH=/usr/local/lib/X11/%T/%N:/home/odyssey/openwin/lib/%T/%N%S
  18.  
  19. It solves the immediate problem with xcdplayer.  The XAPPSRESDIR variable can
  20. also be used.  Attached is the FAQ page that I received regarding these
  21. variables:
  22.  
  23. >From oj@roadrunner.pictel.com Thu Jul 23 07:33:53 1992
  24.  
  25. >From the FAQ distribution:
  26.  
  27. ----------------------------------------------------------------------
  28. Subject:  33)+ How does Xt use environment variables in loading resources?
  29.  
  30.     You can use several environment variables to control how resources are 
  31. loaded for your Xt-based programs -- XFILESEARCHPATH, XUSERFILESEARCHPATH, and 
  32. XAPPLRESDIR.  These environment variables control where Xt looks for 
  33. application-defaults files as an application is initializing.  Xt loads at most
  34. one app-defaults file from the path defined in XFILESEARCHPATH and another from
  35. the path defined in XUSERFILESEARCHPATH.
  36.  
  37.     Set XFILESEARCHPATH if software is installed on your system in such a 
  38. way that app-defaults files appear in several different directory hierarchies.
  39. Suppose, for example, that you are running Sun's Open Windows, and you also 
  40. have some R4 X applications installed in /usr/lib/X11/app-defaults. You could 
  41. set a value like this for XFILESEARCHPATH, and it would cause Xt to look up 
  42. app-defaults files in both /usr/lib/X11 and /usr/openwin/lib (or wherever your
  43. OPENWINHOME is located):
  44.     setenv XFILESEARCHPATH /usr/lib/X11/%T/%N:$OPENWINHOME/lib/%T/%N
  45.  
  46.     The value of this environment variable is a colon-separated list of
  47. pathnames.  The pathnames contain replacement characters as follows:
  48.     %T        the literal string "app-defaults"
  49.     %N        application class name
  50.     %C        customization resource (R5 only)
  51.     %L        language, locale, and codeset (e.g. "ja_JP.EUC")
  52.     %l        language part of %L  (e.g. "ja") 
  53.  
  54.     Let's take apart the example.  Suppose the application's class name is 
  55. "Myterm". Also, suppose Open Windows is installed in /usr/openwin. (Notice the 
  56. example omits locale-specific lookup.)
  57.     /usr/lib/X11/%T/%N        means /usr/lib/X11/app-defaults/Myterm
  58.     $OPENWINHOME/lib/%T/%N    means /usr/openwin/lib/app-defaults/Myterm
  59.  
  60.     As the application initializes, Xt tries to open both of the above 
  61. app-defaults files, in the order shown.  As soon as it finds one, it reads it 
  62. and uses it, and stops looking for others.  The effect of this path is to 
  63. search first in /usr/lib/X11, then in /usr/openwin.
  64.  
  65.     Let's consider another example. This time, let's set 
  66. XUSERFILESEARCHPATH so it looks for the file Myterm.ad in the current working 
  67. directory, then for Myterm in the directory ~/app-defaults.
  68.     setenv XUSERFILESEARCHPATH ./%N.ad:$HOME/%T/%N
  69.  
  70.     The first path in the list expands to ./Myterm.ad.  The second expands 
  71. to $HOME/app-defaults/Myterm.  This is a convenient setting for debugging 
  72. because it follows the Imake convention of naming the app-defaults file 
  73. Myterm.ad in the application's source directory, so you can run the application
  74. from the directory in which you are working and still have the resources loaded
  75. properly.
  76.  
  77.     With R5, there's another twist.  You may specify a customization 
  78. resource value.  For example, you might run the "myterm" application like this:
  79.     myterm -xrm "*customization: -color"
  80.  
  81.     If one of your pathname specifications had the value
  82. "/usr/lib/X11/%T/%N%C" then the expanded pathname would be
  83. "/usr/lib/X11/app-defaults/Myterm-color" because the %C substitution character 
  84. takes on the value of the customization resource.
  85.  
  86.     The default XFILESEARCHPATH, compiled into Xt, is:
  87.         /usr/lib/X11/%L/%T/%N%C:\  (R5)
  88.         /usr/lib/X11/%l/%T/%N%C:\  (R5)
  89.         /usr/lib/X11/%T/%N%C:\     (R5)
  90.         /usr/lib/X11/%L/%T/%N:\
  91.         /usr/lib/X11/%l/%T/%N:\
  92.         /usr/lib/X11/%T/%N
  93.  
  94.     (Note: some sites replace /usr/lib/X11 with a ProjectRoot in
  95. this batch of default settings.)
  96.  
  97.     The default XUSERFILESEARCHPATH, also compiled into Xt, is 
  98.         <root>/%L/%N%C:\  (R5)
  99.         <root>/%l/%N%C:\  (R5)
  100.         <root>/%N%C:\     (R5)
  101.         <root>/%L/%N:\
  102.         <root>/%l/%N:\
  103.         <root>/%N:
  104.  
  105.     <root> is either the value of XAPPLRESDIR or the user's home directory 
  106. if XAPPLRESDIR is not set.  If you set XUSERFILESEARCHPATH to some value other 
  107. than the default, Xt ignores XAPPLRESDIR altogether.
  108.  
  109.     Notice that the quick and dirty way of making your application find 
  110. your app-defaults file in your current working directory is to set XAPPLRESDIR 
  111. to ".", a single dot.  In R3, all this machinery worked differently; for R3 
  112. compatibilty, many people set their XAPPLRESDIR value to "./", a dot followed 
  113. by a slash.
  114.  
  115.  
  116. -- 
  117. harvard\
  118.   ucbvax!uwvax!astroatc!ftms!brown  or  uu2.psi.com!ftms!brown
  119. rutgers/
  120. INTERNET: brown@wi.extrel.com  or  ftms!brown%astroatc.UUCP@cs.wisc.edu
  121.