home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 June / SGI Freeware 1998 June.iso / dist / fw_ATxgopher.idb / usr / freeware / doc / xgopher / Customization.z / Customization
Encoding:
Text File  |  1998-01-21  |  15.2 KB  |  356 lines

  1. Customizing Xgopher
  2. -------------------
  3. This document describes how an end user may change color, fonts, and
  4. other some behavior of Xgopher.  It also documents some other parameters
  5. that may be configured at installation time.
  6.  
  7. When we refer to setting an X resource we allow the readers to choose
  8. the methods that they are most familiar with already.  There are many
  9. ways to set resources for X Window System applications.  We refer you
  10. to a standard reference for X such as "X Window System User's Guide" by
  11. Quercia and O'Reilly, published by O'Reilly & Associates, Inc.
  12.  
  13. We also use the term "application defaults" as another way to refer to
  14. the resources of an application.
  15.  
  16.  
  17.  
  18. Color
  19. -----
  20.  
  21. When displayed on a black and white X display Xgopher will normally 
  22. have a white background and a black foreground.  That is, text, borders,
  23. and lines will be black on white.  If you prefer the opposite visual
  24. effect, you may use the standard X Toolkit option -rv on the command
  25. line or "reverseVideo: True" in your resources file.  The reverse
  26. video option is processed by all clients, including Xgopher, that use
  27. the X Toolkit for argument processing.  The effect of this option is
  28. to reverse all occurrences of the colors black and white.  (Some clients,
  29. such as Xterm, do not process -rv correctly.)
  30.  
  31. A suggested color scheme is distributed with Xgopher.  The easiest way
  32. to change colors is just to modify these supplied resources.  Most
  33. of those color resources are specified for an entire class of widget.
  34. For example, rather than setting the color of each button individually,
  35. the resources file contains the line
  36.  
  37.     Xgopher*Command*background:  LemonChiffon
  38.  
  39. Which sets the background for all widgets which are of class "Command"
  40. (the push button) or are subclasses of Command.  Note that class names
  41. are capitalized.
  42.  
  43. The internal border color resource (internalBorderColor) is not well
  44. known.  It separates the panes of the "paned" widget, the one used for
  45. the main Xgopher panel.  If you change the color of other lines and
  46. borders, be sure to change this one also.
  47.  
  48.  
  49.  
  50. Font
  51. ----
  52.  
  53. The fonts in the distributed resources file may be changed also.  Most
  54. of the Xgopher displays will size themselves according to the font
  55. selected.  The main Xgopher panel is an exception.  If you change the
  56. font size considerably from the default you may need to change the
  57. following resources:
  58.  
  59.     Xgopher*directoryForm.preferredPaneSize:  300
  60.     Xgopher*bookmarkForm.preferredPaneSize:   125
  61.     Xgopher*status.width:           500
  62.     Xgopher*directoryTitle.width:   500
  63.     Xgopher*bookmarkTitle.width:    500
  64.     Xgopher*directory.width:        500
  65.     Xgopher*bookmark.width:         500
  66.  
  67. The first two are the height in pixels of the initial directory and 
  68. bookmark areas of the main panel.  The last 5 should all be the same
  69. and are the width of the main panel in pixels.  You will probably have
  70. to determine these numbers from inspection after changing the fonts.
  71.  
  72. In the resources file are suggested alternative fonts for a larger 
  73. display to be read by more than one person at a time.  At the University
  74. of Illinois we use Xgopher on a 19-inch display with a touch screen
  75. instead of a mouse.  Here the font used for directory presentation is
  76. a 24-point font to allow reasonably accurate selection with a fingertip.
  77. This makes the main panel almost the height of the screen,
  78.  
  79.  
  80.  
  81. Text and Labels
  82. ---------------
  83.  
  84. Every button, menu item, and label have there text value defined in the
  85. resources file.  Some messages and most errors are constructed in the
  86. code itself and would be more difficult to change by the end user.
  87. The labels can be changed to make them more terse, more verbose, or
  88. non-English.  Xgopher does not use any I18N functions, so you are still
  89. restricted pretty much to the ISO Latin-1 character set.  This allows for
  90. most European languages to be used, but not many others.
  91.  
  92.  
  93.  
  94. Translations
  95. ------------
  96.  
  97. The X Toolkit defines a mapping from keyboard and mouse events to
  98. application-defined actions.  Some of these are built in to standard
  99. components, for example, "clicking" mouse button 1 inside a command
  100. (push button) widget will activate that function.  You may redefine
  101. this behavior if you wish.  Volume 4 of the O'Reilly series on the
  102. X window system provides a reference for this ("X Toolkit Intrinsics
  103. Programming Manual", by Nye and O'Reilly, O'Reilly & Associates, Inc).
  104.  
  105. For a one-button mouse or touch screen, the default scrollbar behavior
  106. is not usable.  The following translations work better:
  107.  
  108.   *Scrollbar.Translations: \
  109.       <Btn1Down>:   StartScroll(Continuous)MoveThumb()NotifyThumb()\n\
  110.       <Btn1Motion>: MoveThumb()NotifyThumb()\n\
  111.       <BtnUp>:   NotifyScroll(Proportional)EndScroll()\n\
  112.       <Key>F35:  StartScroll(Forward)NotifyScroll(Proportional)EndScroll()\n\
  113.       <Key>F29:  StartScroll(Backward)NotifyScroll(Proportional)EndScroll()\n
  114.  
  115. The first three lines allow button one alone to move up or down in the
  116. scrolling region by clicking or by dragging the "thumb".  The last two
  117. lines define the keys on a Sun SparcStation 1 keyboard labeled "PgDn"
  118. and "PgUp" to be used instead of the mouse to scroll down or up.
  119.  
  120. Xgopher also defines some of its own actions that you may define a 
  121. translation for.  Most of the text entry panels that accept only a 
  122. single line of input define an action for the "Ok" function.  The default
  123. translations for each of these defines a "return" ("enter") key press
  124. to invoke the "Ok" action.  If you press "return" on the file-save,
  125. index-search, or cso-name-server panels after entering text, it is the
  126. same as pressing the "Ok" (or "do query") function.
  127.  
  128. On the main Xgopher panel there is an "up" action defined equal to
  129. the "previous directory" button.  Pressing the "u" key while the X
  130. pointer is anywhere on the main panel will invoke this function.
  131.  
  132. All of the above translations may be eliminated or changed by modifying
  133. the translations in the resources file.
  134.  
  135.  
  136.  
  137. Size and constraint resources
  138. -----------------------------
  139.  
  140. Most of the resources in Xgopher are for setting the size or placement
  141. constraints on individual components of the user interface.  The 
  142. constraint widgets should not be changed by most people.  To change
  143. one of these may have consequences beyond that of changing a color for
  144. example.  Most of the constraint resources have been moved into the program
  145. (out of harm's way).
  146.  
  147. The size resources described in the above section on fonts may be safely
  148. changed, but usually are only changed to accommodate a larger or smaller
  149. character size.
  150.  
  151.  
  152.  
  153. Window Manager Behavior
  154. -----------------------
  155.  
  156. The Xgopher pixmap supplied in the file bitmaps/xgopher.xbm can be used
  157. as the icon for the Xgopher application when using one of the common
  158. window managers.  If xgopher.xbm is installed into the directory
  159. <pathname>, you can use it as the icon for all Xgopher windows by
  160. including the folling line in your resource file:
  161.  
  162.     Xgopher*iconPixmap:     <pathname>/xgopher.xbm
  163.  
  164. (Adjust the path name to reflect the actual path name of the bitmap
  165. file.)  Individual types of Xgopher windows can be similarly configured
  166. to have distinct bitmaps, but these are not supplied with Xgopher.
  167.  
  168. While not strictly an Xgopher customization option, the window manager
  169. may be configured to better interface with Xgopher.  Since Xgopher uses
  170. several top-level windows and transient windows some of these options may
  171. make Xgopher easier to use.  The two window managers in most common use
  172. are twm (and its descendents) and mwm.
  173.  
  174. Each of these has an option that will either automatically place a newly
  175. created window on the screen or allow the user to move and position
  176. an outline of the window first.
  177.  
  178. Another option available is whether to "decorate" transient windows.
  179. These are short-lived windows usually asking for information (e.g.,
  180. file-save or index-search).  The decorations are the title bar and various
  181. menu/kill/iconify type of buttons that usually are placed on or near the
  182. title bar.
  183.  
  184. You can use a window manager option to set the icon pixmap instead of
  185. the Xgopher*iconPixmap resource described above.
  186. The  bitmap image is supplied in the directory ./bitmaps/xgopher.xbm
  187. and is suitable for use as a window manager icon.  If xgopher.xbm
  188. is installed into the directory <pathname>, you can use it as an
  189. icon bitmap under mwm by including the lines in your mwm resource
  190. file:
  191.  
  192.     Mwm*useClientIcon:              True
  193.     Mwm*Xgopher*iconImage:          <pathname>/xgopher.xbm
  194.  
  195. Similar resources apply to twm.  In your .twmrc file, use:
  196.  
  197.     # if the directory containing xgopher.xbm is not already
  198.     # in your bitmapFilePath, add:
  199.     IconDirectory                   "<pathname>/bitmaps"
  200.     Icons
  201.     {
  202.         "Xgopher"       "xgopher.xbm"
  203.     }
  204.  
  205. For both mwm and twm other resources may also affect your icon appearance.
  206.  
  207. You may want to install the icon file in the directory /usr/lib/X11/Xgopher/,
  208. or wherever the help file is already stored.  If you do put the icon bitmap
  209. somewhere, you may want to modify the Xgopher man page to provide this
  210. information to other users.
  211.  
  212. Finally, most window manager provide a main window menu that includes
  213. functions to move, resize, iconify, and terminate a window.  The
  214. termination function is processed specially by both the window manager
  215. and the application.  Xgopher complies with the window manager protocol
  216. that allows the window manager to ask the client to shut down rather
  217. than just suddenly and ungracefully killing the client application.
  218.  
  219. mwm's "f.kill" function will correctly inform Xgopher that a "remove"
  220. request has been made against a given window.  Xgopher will close and
  221. remove that window.  If the window is the main panel, Xgopher will quit.
  222.  
  223. twm's "f.delete" behaves in a manner similar to mwm's f.kill function.
  224. It is deficient in that for clients that do not honor the ICCCM
  225. conventions, f.delete will have no effect except to provide an audible
  226. beep.  twm's "f.destroy" function is quite harsh.  There is no intercepting
  227. its action.  It will simply destroy the entire application, no matter
  228. which window of the application was selected.  f.delete should be normally
  229. used in a windows main menu.  f.destroy should be used in only when
  230. absolutely necessary.  
  231.  
  232.  
  233.  
  234. Image display
  235. -------------
  236.  
  237. Xgopher displays an image file by invoking another command which must
  238. be already installed or available on your system (on the same host
  239. as is running the Xgopher program).  Normally, this auxiliary program
  240. is xloadimage.  You can change this and use another program by changing
  241. the resource:
  242.  
  243.     Xgopher.imageCommand: xloadimage
  244.  
  245. to use some other command.  If you have a program called "xv", another
  246. image display program, installed, that is a good alternative.  
  247.  
  248.  
  249.  
  250. Telnet and tn3270 sessions
  251. --------------------------
  252.  
  253. Xgopher provides a telnet or tn3270 session by invoking another command
  254. which must be already installed or available on your system (on the same
  255. host as is running the Xgopher program).  Normally, two additional
  256. programs are required: xterm and telnet (or xterm and tn3270).  xterm
  257. provides a new terminal emulator window with vt100 (or ansi) terminal
  258. behavior.  Telnet or tn3270 are simply run as programs in that window.
  259. You can change this and use another program by changing the resources:
  260.  
  261.     Xgopher.telnetCommand: xterm -e telnet
  262.     Xgopher.tn3270Command: xterm -e tn3270
  263.  
  264. to use some other command.  If you are using an IBM Risc System/6000, then
  265. you really should use aixterm to run tn3270 as xterm and tn3270 do not
  266. coexist very well with the default keyboard mappings.  For IBM RS/6000:
  267.  
  268.     Xgopher.tn3270Command: aixterm -e tn3270
  269.  
  270. If you have another telnet-capable program installed on your system,
  271. you may change these commands to use your own program.  One alternative
  272. for tn3270 sessions is a program called X3270.  If provides at least
  273. a better visual emulation of an IBM 3278 terminal than does tn3270
  274. in an xterm window.
  275.  
  276.  
  277.  
  278. Better Scrollbars
  279. -----------------
  280.  
  281. There is a modified scrollbar available for the Athena widget library
  282. that gives much better scrollbars than the standard Athena widget library
  283. does.  This improved scrollbar has arrow heads at each end of the bar
  284. that you can click to scroll up or down in addition to other scrollbar
  285. dragging actions for scrolling.  It is amazing how much these arrows add
  286. to the user interface.
  287.  
  288. This scrollbar widget was developed by Mitch Trachtenberg, bases on
  289. the Athena scrollbar widget and should be "plug compatible".
  290. However, it is not easy for me to support this widget directly in
  291. Xgopher.  The reason is that many computer systems have their
  292. Athena widget library generated as a shared object, or otherwise
  293. have the library already internally linked.  So, even if I provide
  294. the new scrollbar source file, and load it, the other Athena widgets
  295. (text and viewport) are already closely tied to the supplied scrollbar
  296. and will not use the new one.  The only sure way to use this new
  297. scrollbar is to re-build your Athena widget library using the 2 new
  298. files supplied by Mitch Trachtenberg.  It is okay to just re-archive
  299. your old ".o" files for Xaw.
  300.  
  301. I cannot support the use of this package, but I have tested it with 
  302. Xgopher on an IBM RS/6000, and really appreciated the appearance and
  303. behavior.  For those installers who feel like building a new Athena
  304. widget library, I recommend this scrollbar.
  305.  
  306. The shar file is available by anonymous ftp from:
  307.     
  308.     export.lcs.mit.edu: contrib/Xaw.Scrollbar.mta
  309.  
  310.  
  311.  
  312. Other Athena-Compatible Widgets
  313. -------------------------------
  314.  
  315. There is a 3-D version of the Athena widget library from
  316. kaleb@jpl-devvax.jpl.nasa.gov, also available on the X11 ftp site:
  317.  
  318.     export.lcs.mit.edu: contrib/Xaw-0.5.tar.Z
  319.  
  320. (That's the version current as of this writing at the end of 1992.)
  321.  
  322. It is "plug-compatible" with the standard Athena widget library.
  323. You can obtain this 3D version, compile it, (possibly install it,) and
  324. link Xgopher with this library instead of your system Xaw library.
  325.  
  326. I cannot support the use of this package, but I have tested it with
  327. Xgopher on an IBM RS/6000.  Especially when using color, there is some
  328. interesting visual effect, but I don't consider the added value
  329. significant enough to recommend using the 3D library.  Much of the
  330. problem stems from the fact that the Athena widgets are not beautiful.
  331. They were intended by the X consortium to be an example widget set, not
  332. necessarily a production one, and it shows (in any number of dimensions).
  333.  
  334.  
  335. There is also supposed to be a "vi" (editor) compatible version of the
  336. Athena text widget available.  I have not tested this widget.  I do not
  337. particularly recommend its use with Xgopher because  Xgopher
  338. is primarily a text display system rather than a text editing system.
  339. So the most you can gain is some familiar way to navigate a displayed
  340. text file.  However, you accomplish much of this by setting the
  341. key translations in the resource file for the existing text widget.
  342. The same installation considerations discussed above for the scrollbar
  343. replacement will be applicable to this replacement text widget.
  344. Here is the introductory paragraph from its distribution:
  345.  
  346.     This is a modified version of the X11R5 Text Widget.  It is designed
  347.     to drop into the X11R5 source tree and replace the original X11R5
  348.     Text Widget.  It will behave identically to the original, unless
  349.     the resource startMode is set to "vi", in which case it will give
  350.     you vi-like modal editing.  By Eric Bina.
  351.  
  352.     On export.lcs.mit.edu (00-index.txt):
  353.       -rw-rw-rw-  1 ftp         95091 Oct 22  1991 ViText.tar.Z
  354.  
  355.  
  356.