home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / tutorials / FAQ.censored < prev    next >
Encoding:
Internet Message Format  |  1991-07-21  |  114.0 KB

  1. Subject: Frequently Asked Questions about X with Answers [long monthly posting]
  2.  
  3. [Last changed: 30 Jun 91]
  4. [For distribution with R5, parts of this document relating to older
  5. problems or containing commercial announcements have been removed.]
  6.  
  7. This article contains the answers to some Frequently Asked Questions (FAQ) 
  8. often seen in comp.windows.x. It is posted to help reduce volume in this 
  9. newsgroup and to provide hard-to-find information of general interest.
  10.  
  11.         Please redistribute this article!
  12.  
  13. This article includes answers to the following questions, which are loosely
  14. grouped into categories. Questions marked with a + indicate questions new to 
  15. this issue; those with significant changes of content since the last issue are 
  16. marked by *:
  17.  
  18.   0)  TOPIC: BASIC INFORMATION SOURCES AND DEFINITIONS
  19.   1)  What books and articles on X are good for beginners?
  20.   2)  [Removed]
  21.   3)  [Removed]
  22.   4)  What X-related public mailing lists are available?
  23.   5)  How do I ask a net-question so as to maximize helpful responses?
  24.   6)  What publications discussing X are available?
  25.   7)  How can I meet other X developers? (What is XUG? AFUX? EXUG?)
  26.   8)  What are these common abbreviations?
  27.   9)  What is the ICCCM? (How do I write X-friendly applications?)
  28.  10)  What is the X Consortium, and how do I join?
  29.  11)  Just what are OPEN LOOK and Motif?
  30.  12)  [Removed]
  31.  13)  [Removed]
  32.  14)  What is PEX?
  33.  15)  TOPIC: USING X IN DAY-TO-DAY LIFE
  34.  16)  What are all these different window managers?
  35.  17)  Why does my X session exit when I kill my window manager?
  36.  18)  Is there a way for my WM to produce my .xinitrc, like toolplaces?
  37.  19)  How do I use another window manager with DEC's session manager?
  38.  20)  How do I change the keyboard auto-repeat rate?
  39.  21)  How do I remap the keys on my keyboard to produce a string?
  40.  22)  How do I make a screendump of the X display?
  41.  23)  How do I make a color PostScript screendump of the X display?
  42.  24)  How can I print the current selection?
  43.  25)  Why are my xterm menus so small?
  44.  26)  Where can I find a dictionary server for xwebster?
  45.  27)  How do I convert/view Mac/TIFF/GIF/Sun/PICT/img/FAX images in X?
  46.  28)  How can I change the titlebar of my xterm window?
  47.  29)  Where can I find the xterm control sequences? [edited]
  48.  30)  How do I keep my $DISPLAY when I rlogin to another machine?
  49.  31)  How can I design my own font?
  50.  32)  Why does adding a font to the server not work?
  51.  33)  How do I convert a ".snf" font back to ".bdf" font?
  52.  34)  What is a general method of getting a font in usable format?
  53.  35)  How do I use HP ".scf" fonts on my MIT R4 server?
  54.  36)  How do I use DECwindows ".pcf" fonts on my MIT R4 server?
  55.  37)  How do I use DECwindows fonts on my non-DECwindows server?
  56.  38)  How do I add ".bdf" fonts to my DECwindows server?
  57.  39)  Why can't I set the backgroundPixmap resource in a defaults file?
  58.  40)  Why does the R3 xterm, et al, fail against the R4 server?
  59.  41)  [Removed]
  60.  42)  How can I have xclock or oclock show different timezones?
  61.  43)  I have xmh, but it doesn't work. Where can I get mh?
  62.  44)  Why am I suddenly unable to connect to my Sun X server?
  63.  45)  Why can't I override translations? Only the first item works.
  64.  46)  How do I report bugs in X?
  65.  47)  TOPIC: OBTAINING X AND RELATED SOFTWARE AND HARDWARE
  66.  48)  Is X public-domain software?
  67.  49)  [Removed]
  68.  50)  [Removed]
  69.  51)  [Removed]
  70.  52)  [Removed]
  71.  53)  [Removed]
  72.  54)  [Removed]
  73.  55)  [Removed]
  74.  56)  Where can I obtain other X sources?
  75.  57)  Where can I obtain interesting widgets?
  76.  58)  Where can I obtain alternate language bindings to X?
  77.  59)  What is the xstuff mail-archive?
  78.  60)  [Removed]
  79.  61)  [Removed]
  80.  62)  [Removed]
  81.  63)  [Removed]
  82.  64)  [Removed]
  83.  65)  [Removed]
  84.  66)  [Removed]
  85.  67)  Where can I get an "X terminal" server for my low-end Sun 3/50?
  86.  68)  [Removed]
  87.  69)  [Removed]
  88.  70)  [Removed]
  89.  71)  Where can I obtain an X-based plotting program?
  90.  72)  [Removed]
  91.  73)  [Removed]
  92.  74)  [Removed]
  93.  75)  [Removed]
  94.  76)  Where can I get an X-based TeX or DVI previewer?
  95.  77)  [Removed]
  96.  78)  [Removed]
  97.  79)  Where can I find X tools callable from shell scripts?
  98.  80)  [Removed]
  99.  81)  [Removed]
  100.  82)  TOPIC: BUILDING THE X DISTRIBUTION 
  101.  83)  How do I build X with gcc?
  102.  84)  [Removed]
  103.  85)  What are these I/O errors running X built with gcc?
  104.  86)  What are these problems compiling X11R4 with "gcc -traditional"?
  105.  87)  What are these problems compiling X11R4 on the older Sun3?
  106.  88)  What are these problems compiling the X11R4 server on SunOS 4.1.1?
  107.  89)  What are these problems using R4 shared libraries on SunOS 4?
  108.  90)  [Removed]
  109.  91)  [Removed]
  110.  92)  TOPIC: BUILDING X PROGRAMS
  111.  93)  What is Imake?
  112.  94)  Where can I get imake?
  113.  95)  I have a program with an Imakefile but no Makefile. What to do?
  114.  96)  Why can't I link to the Xlib shape routines?
  115.  97)  What are these problems with "_XtInherit not found" on the Sun?
  116.  98)  Why can't I compile my R3 Xaw contrib programs under R4?
  117.  99)  TOPIC: PROGRAMMING PROBLEMS AND PUZZLES
  118. 100)  Why doesn't my program get the keystrokes I select for?
  119. 101)  How do I figure out what window manager is running?
  120. 102)  Is there a skeleton X program available?
  121. 103)  Why does XtGetValues not work for me?
  122. 104)  Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
  123. 105)  How can my application tell if it is being run under X?
  124. 106)  How do I make a "busy cursor" while my application is computing?
  125. 107)  How do I query the user synchronously using Xt?
  126. 108)  How do I fork without hanging my parent X program?
  127. 109)  Why does XtAppAddInput not work as described?
  128. 110)  How do I simulate a button press/release event for a widget?
  129. 111)  Why doesn't anything appear when I run this simple program?
  130. 112)  What is the difference between a Screen and a screen?
  131. 113)  [Removed]
  132. 114)  How do I determine the name of an existing widget?
  133. 115)  What widget is appropriate to use as a drawing canvas?
  134. 116)  Why do I get a BadDrawable error drawing to XtWindow(widget)?
  135. 117)  Can XGetWindowAttributes get a window's background pixel/pixmap?
  136. 118)  Why doesn't GXxor produce mathematically-correct color values?
  137. 119)  Why does the pixmap I copy to the screen show up as garbage? 
  138. 120)  How can my application iconify itself?
  139. 121)  How do I check whether a window ID is valid?
  140. 122)  Why can't my program work with tvtwm or swm?
  141. 123)  Can I have two applications draw to the same window?
  142. 124)  How do I keep a window from being resized by the user?
  143. 125)  How do I render rotated text?
  144. 126)  Why can't my program get a standard colormap?
  145. 127)  What is the X Registry? (How do I reserve names?)
  146.  
  147. If you have suggestions or corrections for any of these answers or any 
  148. additional information, please send them directly to xug@expo.lcs.mit.edu;
  149. the information will be included in the next revision (or possibly the one 
  150. after that; thanks for the many suggestions which haven't been incorporated 
  151. yet).  
  152.  
  153. This posting is intended to be distributed at approximately the beginning of 
  154. each month. New versions may be archived on export.lcs.mit.edu, uunet, and 
  155. 132.206.1.1.
  156.  
  157. The information contained herein has been gathered from a variety of sources. In
  158. many cases attribution has been lost; if you would like to claim responsibility
  159. for a particular item, please let us know. 
  160.  
  161. Conventions used below: telephone numbers tend to be Bell-system unless 
  162. otherwise noted; prices on items are not included.
  163.  
  164. All trademarks are the property of their respective owners.
  165.  
  166. ----------------------------------------------------------------------
  167. Subject:   0)  TOPIC: BASIC INFORMATION SOURCES AND DEFINITIONS
  168. ----------------------------------------------------------------------
  169. Subject:   1)  What books and articles on X are good for beginners?
  170.  
  171.     Ken Lee of the DEC Western Software Laboratory (klee@wsl.dec.com) 
  172. regularly posts to comp.windows.x and ba.windows.x a bibliography containing 
  173. cites of all known reference books and how-to manuals and also cites of 
  174. selected technical articles on X and X programming; it is ftp-able as 
  175.     export.lcs.mit.edu:/contrib/Xbibliography and 
  176.     gatekeeper.dec.com:/archive/pub/X11/contrib/Xbibliography 
  177.  
  178. Here is an unordered set of the reference books and tutorials most useful for
  179. beginners; most appear on that list [comments are gathered from a variety of 
  180. places and are unattributable]:
  181.  
  182. Asente, Paul J., and Swick, Ralph R., "X Window System Toolkit, The Complete
  183. Programmer's Guide and Specification", Digital Press, 1990.  The bible on Xt. A 
  184. treasury of information, excellent and invaluable.  Distributed by Digital 
  185. Press, ISBN 1-55558-051-3, order number EY-E757E-DP; and by Prentice-Hall, 
  186. ISBN 0-13-972191-6. Also available through DEC Direct at 1-800-DIGITAL. 
  187. [The examples are on export.lcs.mit.edu in contrib/ and on gatekeeper.dec.com 
  188. (16.1.0.2) in pub/X11/contrib as asente-swick.examples.tar.Z.  They were also 
  189. recently posted to comp.sources.x as xt-examples/part0[1-5].]
  190.  
  191. Jones, Oliver, Introduction to the X Window System, Prentice-Hall, 1988, 1989.
  192. ISBN 0-13-499997-5. An excellent introduction to programming with Xlib.  
  193. Written with the programmer in mind, this book includes many practical tips 
  194. that are not found anywhere else. This book is not as broad as the O'Reilly 
  195. Xlib tutorial, but Jones is an experienced X programmer and this shows in the 
  196. quality and depth of the material in the book. Originally written for X11R1, 
  197. recent printings have included corrections and additions.  The sixth printing 
  198. should have X11R4 material.
  199.  
  200. Young, Doug. "The X Window System: Applications and Programming with Xt (Motif 
  201. Version)," Prentice Hall, 1989 (ISBN 0-13-497074-8). The excellent tutorial 
  202. "X Window Systems Programming and Applications with Xt," (ISBN 0-13-972167-3) 
  203. updated for Motif. [The examples from the Motif version are available on export 
  204. in ~ftp/contrib/young.motif.tar.Z]
  205.  
  206. Scheifler, Robert, and James Gettys, with Jim Flowers, Ron Newman, and David 
  207. Rosenthal, "X Window System: The Complete Reference to Xlib, X Protocol, ICCCM,
  208. XLFD, Second Edition," Digital Press, 1990. "The Bible", an enhanced version of
  209. X documentation by the authors of the Xlib documentation. This is the most 
  210. complete published description of the X programming interface and X protocol. 
  211. It is the primary reference work and is not introductory tutorial documentation;
  212. additional tutorial works will usually be needed by most new X programmers.
  213. Digital Press order EY-E755E-DP. DP ISBN 1-55558-050-5;  
  214. Prentice-Hall ISBN 0-13-972050-2
  215.      
  216. Nye, Adrian, "Xlib Programming Manual, Volume 1" and "Xlib Reference Manual, 
  217. Volume 2," O'Reilly and Associates, 1988. A superset of the MIT X documentation;
  218. the first volume is a tutorial with broad coverage of Xlib, and the second
  219. contains reference pages for Xlib functions and many useful reference 
  220. appendices.  ISBN 0-937175-26-9 (volume 1) and ISBN 0-937175-27-7 (volume 2).
  221. [A version updated for X11R4 is available (4/90).]
  222.  
  223. Nye, Adrian, and Tim O'Reilly, "X Toolkit Programming Manual, Volume 4,"
  224. O'Reilly and Associates, 1989. The folks at O'Reilly give their comprehensive
  225. treatment to programming with the MIT Intrinsics; R4 versions are now
  226. available, as is a Motif 1.1 version (Volume 4M).
  227.  
  228. O'Reilly, Tim, ed.,  "X Toolkit Reference Manual, Volume 5," O'Reilly and 
  229. Associates, 1989.  A professional reference manual for the MIT X11R3 Xt; some 
  230. information on X11R4 is included.
  231.  
  232. Mansfield, Niall. "The X Window System: A User's Guide," Addison-Wesley, 1989.
  233. A tutorial introduction to using X, soon to be upgraded for R4. 
  234. ISBN 0-201-51341-2.
  235.  
  236. Miller, John David. "An Open Look at UNIX", M&T Books, 1990.  An Xt book with
  237. information on OLIT and the OPEN LOOK extensions to for interfacing with the
  238. file and workspace managers.  ISBN 1-55851-058-3 (with disk).
  239.  
  240. Quercia, Valerie and Tim O'Reilly. "X Window System User's Guide," O'Reilly and
  241. Associates, 1989. A tutorial introduction to using X. ISBN 0-937175-36-6.
  242. Also available in R4 and Motif flavors.
  243.  
  244. Rosenthal, David S.H., "Inter-Client Communication Conventions Manual Version 
  245. 1.0 (MIT Consortium Standard)." The first real ICCCM, available on the R4 tape;
  246. a version is also available from the xstuff mail-archive-server.
  247.  
  248. (Prentice-Hall ordering is 201-767-5937. O'Reilly ordering is 800-338-NUTS.)
  249.  
  250. In addition, check the X11R4 core distribution in doc/tutorials for some useful
  251. papers and tutorials, particularly the file doc/tutorials/answers.txt.  "Late 
  252. Night's Top Ten X11 Questions" by Dave Lemke (lemke@ncd.com) and Stuart Marks 
  253. (smarks@sun.com) answers other common questions and some of these here in more 
  254. detail.
  255.  
  256. ----------------------------------------------------------------------
  257. Subject:   4)  What X-related public mailing lists are available?
  258.  
  259.     The xpert mailing list is the general, public mailing list on X
  260. maintained by the X Consortium. The mailings are gatewayed, so xpert is almost 
  261. identical to the comp.windows.x Usenet newsgroup. 
  262.  
  263.     ***    If you get comp.windows.x, you don't need to     ***
  264.     ***    be added to the xpert mailing list.         ***
  265.  
  266.     Otherwise, you can join the list to receive X information 
  267. electronically. It is best to find a local distribution; perhaps someone within
  268. your company is already receiving the mailing. As a last resort, send mail to 
  269. xpert-request@expo.lcs.mit.edu with a valid return electronic address. 
  270.  
  271.     A mailing list for major X announcements (new releases, public reviews,
  272. adoption of standards, but NOT advertisements, patches, or questions) is 
  273. available by request from xannounce-request@expo.lcs.mit.edu. Messages sent to 
  274. xannounce will automatically be sent to the xpert mailing list.  They will not 
  275. be sent to the Usenet news group comp.windows.x; however, they will appear in 
  276. the Usenet news group comp.windows.x.announce.  Note: Only redistribution 
  277. addresses will be accepted for this list -- i.e. no personal addresses. If you 
  278. wish to receive xannounce yourself, please contact your mail administrator to 
  279. set up a local redistribution list and to put you on it.  
  280.  
  281.     In addition, the X Consortium sponsors these public lists:
  282.         bug-clx         CLX bug reports and discussions
  283.         x-ada           X and ada
  284.         x11-3d          people interested in X and 3d graphics
  285.         ximage          people interested in image processing and X
  286.         xvideo          discussion of video extensions for X
  287.     To subscribe to one of these lists, assuming no-one in your 
  288. organization already receives it, send mail to <list>-request@expo.lcs.mit.edu
  289. with the Subject line including the name of the LIST in caps and the request
  290. "addition request".  In the body of the message be sure to give an address for 
  291. your local distribution which is accessible from MIT (eddie.mit.edu).
  292.  
  293.     A mailing list for topics related to OPEN LOOK is sponsored by Greg
  294. Pasquariello of Unify corporation; send to openlook-request@unify.com (or
  295. openlook-request%unify.uucp@uunet.uu.net) for information. 
  296.     A mailing list for bugs in the publicly-available version of XView
  297. source, in particular, is sponsored by Sun; send for information to 
  298. xviewbug-trackers-request@sun.com. 
  299.     A mailing list for topics related to Motif is sponsored by Kee Hinckley
  300. of Alfalfa Software, Inc.; send to motif-request@alfalfa.com for information. 
  301. (This group is gatewayed to comp.windows.x.motif.)
  302.     A mailing list for topics related to the XPM pixmap-format is sponsored
  303. by Arnaud Le Hors of Group Bull; send to xpm-talk-request@mirsa.inria.fr for
  304. information. [1/91]
  305.     A mailing list discussing InterViews can be subscribed to by sending to 
  306. interviews-request@interviews.stanford.edu.
  307.     A mailing list (amiga-x11@nic.funet.fi) for topics related to the port 
  308. of X11 to the Amiga can be subscribed by sending to mailserver@nic.funet.fi a 
  309. message containing
  310.         Subject: Adding myself to AMIGA-X11
  311.         SUBS AMIGA-X11 Your Real Name
  312.  
  313. ----------------------------------------------------------------------
  314. Subject:   5)  How do I ask a net-question so as to maximize helpful responses?
  315.  
  316.     When asking for help on the net or X mailing lists, be sure to include 
  317. all information about your setup and what you are doing.  The more specific you
  318. are, the more likely someone will spot an error in what you are doing.  Without
  319. all the details, people who want to help you often have to guess -- if they are
  320. able to respond at all.
  321.  
  322.     Always mention what version of X you are using and where you got it 
  323. from. If your server came from a different source as the rest of your X system,
  324. give details of that, too.  Give the machine type, operating system, and O/S 
  325. version for both the client and server machine.  It may also be appropriate to 
  326. mention the window manager, compiler, and display hardware type you are using.
  327.  
  328.     Then tell exactly what you are doing and exactly what happens.  If it is
  329. a command that fails, include the exact transcript of your session in the 
  330. message.  If a program you wrote doesn't work the way you expect, include 
  331. as much of the source necessary for readers to reproduce the problem.
  332.  
  333. ----------------------------------------------------------------------
  334. Subject:   6)  What publications discussing X are available?
  335.  
  336.     The trade magazines (Unix World, Unix Review, Computer Language, etc.)
  337. are publishing more articles on X. In addition to XNextEvent:
  338.  
  339.     - O'Reilly and Associates announced at the 5th MIT conference a 
  340. quarterly journal, The X Resource, devoted to a variety of X topics. Editorial 
  341. information: Adrian Nye, adrian@ora.com.
  342.  
  343.     - The X Journal is slated to start bi-monthly publication September 
  344. 1991 on a variety of X topics. Editorial information: Jerry Smith, Editor, 
  345. 615-886-3429, jsmith%spectro.uucp@uunet.uu.net. Subscription information:
  346. The X Journal, Subscriber Services, Dept XXX, P.O. BOX 3000, Denville, NJ 07834,
  347. USA.
  348.  
  349. ----------------------------------------------------------------------
  350. Subject:   7)  How can I meet other X developers? (What is XUG? AFUX? EXUG?)
  351.  
  352.     The national X User's Group was formed in January of 1988.  Its purpose
  353. is to encourage X development by providing information on the X Window System 
  354. to all who are interested. [This FAQ is a service of XUG.]
  355.  
  356.     - Local Area Groups: [this list is always in the process of being 
  357. updated; some of these groups are known to be zombies]:
  358.     Atlanta, GA        James Tio, 404-441-4784
  359.     Bay Area, CA         Jim Turner, 415-960-0123
  360.     Boston             Mitch Trachtenberg, mitch@lta.com
  361.     Chicago            Jerry Walton, 219-736-2667
  362.     Cleveland         Mike Kolberg, 216/243-1198
  363.     Colorado        Jim West, 719/260-3463, west@widgit.enet.dec.com
  364.     South Florida ("SFXUG")    Gary M. Paxinos, 407-243-2405, pax@megasys.com
  365.                 Morgan Von Essen, morgan@metrolink.com
  366.                 Mahesh Neelakanta, mahesh@shark.cs.fau.edu
  367.     Houston         Dinah G. McNutt, dinah@bcm.tmc.edu
  368.                     713-798-5890
  369.     Huntsville, Ala.    Pete Shea 205-837-9230
  370.     Los Angeles ("LAX")    Debbie Catalano, catalano@inference.com,
  371.                 213-322-5004 x194
  372.     Michigan ("MIX")    JT Vogt, JLV@MD-DET.Prime.COM, (313) 689-0100
  373.                 or Brian Smithson (313) 354-5118
  374.     Pittsburgh, PA        John Kochmar, kochmar@sei.cmu.edu
  375.                 (412)268-6396
  376.     Princeton, NJ         Joe Camaratta, 609-734-6500
  377.     Research Triangle Park     Steven Thiedke, 919/481-1353
  378.     Washington, DC         Thomas Fagre, 703/866-7425
  379.  
  380.     Canada            Ken Ristevski, 416-470-1203
  381.     Cambridge, UK        Ray Anderson, +44 223 462131
  382.     Israel            Warren Burstein, warren@worlds.uu.net
  383.                 Yosi Ben-Harosh, +972 52 522266
  384.     Milan, Italy        Richard Glover, (39) 961-743-486
  385.     Singapore        Chee Keong Law, 772-3116
  386.                 ISSLCK%NUSVM.BITNET@mitvma.mit.edu
  387.     
  388.     To join, form a local group, contribute to XNextEvent (the several-
  389. times-yearly newsletter which includes articles of general interest, or help 
  390. out in any other way, contact Alex Fisher at XUG, c/o Integrated Computer 
  391. Solutions, 201 Broadway, Cambridge, MA 02139-9890, 617/621-0060#108, or email 
  392. to the human at xug@expo.lcs.mit.edu. 
  393.  
  394. In addition, there are meetings of these groups:
  395.     - Bay Area Motif Developers Group and Drinking Society
  396.                     Ron Edmark edmark@isi.com
  397.  
  398.     The French X User Group is called AFUX and is based in Sophia Antipolis
  399. by CERICS. Information can be obtained from Miss Vasseur or Miss Forest; BP 148;157, rue Albert Einstein; 06561 Valbonne Cedex; Phone: +33 93 95 45 00 / 45 01;
  400. Fax: +33 93 95 48 57.  [10/90]
  401.  
  402.     The European X User Group was formed in 1989 to represent X users in 
  403. Europe.  It holds technical conferences at regular intervals. The EXUG also 
  404. publishes a regular newsletter which is distributed free of charge to members. 
  405. The EXUG also runs a email mailing list for members which is frequently used to
  406. address issues of European interest in X. The EXUG can be contacted by email 
  407. at: exug@unipalm.uucp or by snail mail at:  The EXUG, Mitchell House, 185 High 
  408. Street, Cottenham, Cambridge CB4 4RX, England; phone +44 954 51727.
  409. [from Bevis King (brwk@doc.ic.ac.uk), 4/90]
  410.  
  411.     GXUGiV is the German X User's Group in Vorbereitung ("in preparation")
  412. being formed for X programmers and users; it is associated with the EXUG. All
  413. interested should contact Olaf Heimburger (+49 30 7 79 54 64; and at
  414. mcvax!unido!tub!olaf).
  415.  
  416. ----------------------------------------------------------------------
  417. Subject:   8)  What are these common abbreviations?
  418.  
  419.     Xt: The X Toolkit Intrinsics is a library layered on Xlib which 
  420. provides the functionality from which the widget sets are built. An "Xt-based" 
  421. program is an application which uses one of those widget sets and which uses 
  422. Intrinsics mechanisms to manipulate the widgets.
  423.     Xmu: The Xmu library is a collection of Miscellaneous Utility functions
  424. useful in building various applications and widgets.
  425.     Xaw: The Athena Widget Set is the MIT-implemented sample widget set
  426. distributed with X11 source since X11R2.
  427.     Xm: The OSF/Motif widget set from the Open Software Foundation; binary
  428. kits are available from many hardware vendors
  429.     Xhp (Xw): The Hewlett-Packard Widget Set was originally based on R2++, 
  430. but several sets of patches exist which bring it up to R3, as it is distributed
  431. on the X11R4 tapes. Supplemental patches are available to use it with R4.
  432.     CLX: The Common Lisp X Interface is a Common Lisp equivalent to Xlib.
  433.     XDMCP: The X Display Manager Protocol provides a uniform mechanism for 
  434. a display such as an X terminal to request login service from a remote host.
  435.     XLFD: The X Logical Font Description Conventions describes a standard
  436. logical font description and conventions to be used by clients so that they
  437. can query and access those resources.
  438.     RTFM: Common expert-speak meaning "please locate and consult the 
  439. relevant documentation -- Read the Forgotten Manual".
  440.     UTSL: A common expression meaning "take advantage of the fact that you 
  441. aren't limited by a binary license -- Use The Source, Luke".
  442.  
  443. ----------------------------------------------------------------------
  444. Subject:   9)  What is the ICCCM? (How do I write X-friendly applications?)
  445.  
  446.     The Inter-Client Communication Conventions Manual is one of the 
  447. official X Consortium standards documents that define the X environment. It 
  448. describes the conventions that clients must observe to coexist peacefully with 
  449. other clients sharing the same server.  If you are writing X clients, you need 
  450. to read and understand the ICCCM,  in particular the sections discussing the 
  451. selection mechanism and the interaction between your client and the window 
  452. manager.  Get it either:
  453.     - as part of the R4 distribution from MIT.
  454.     - in the 2nd edition of the Scheifler/Gettys "X Window System" book.
  455.     - as an appendix in the new version of O'Reilly's Volume 0, "X Protocol
  456. Reference Manual." A version in old copies of their Volume 1 is obsolete.
  457.     The version in the DP book is much more readable, thanks to the efforts
  458. of Digital's editors to improve the English and the presentation.
  459.  
  460. [from David Rosenthal, 10/90]
  461.  
  462.     Alternate definition: the ICCCM is generally the M in "RTFM" and is
  463. the most-important of the least-read X documents.
  464.  
  465. ----------------------------------------------------------------------
  466. Subject:  10)  What is the X Consortium, and how do I join?
  467.  
  468.     The MIT X Consortium was formed in January of 1988 to further the
  469. development of the X Window System and has as its major goal the promotion of 
  470. cooperation within the computer industry in the creation of standard software 
  471. interfaces at all layers in the X Window System environment.
  472.     MIT's role is to provide the vendor-neutral architectural and 
  473. administrative leadership required to make this work. Membership in the 
  474. Consortium open to any organization.  There are two categories of membership, 
  475. Member (for large organizations) and Affiliate (for smaller organizations).
  476.     Most of the Consortium's activities take place via electronic mail, 
  477. with meetings when required.  As designs and specifications take shape,
  478. interest groups are formed from experts in the participating organizations.  
  479. Typically a small multi-organization architecture team leads the design, with 
  480. others acting as close observers and reviewers.  Once a complete specification
  481. is produced, it may be submitted for formal technical review by the Consortium
  482. as a proposed standard.  The standards process typically includes public 
  483. review (outside the Consortium) and a demonstration of proof of concept.
  484.     Your involvement in the public review process or as a Member or 
  485. Affiliate of the Consortium is welcomed.
  486.     Write to: Bob Scheifler, MIT X Consortium, Laboratory for Computer 
  487. Science, 545 Technology Square, Cambridge, MA 02139.
  488.  
  489. [For complete information see the XCONSORTIUM man page from the X11R4
  490. distribution, from which this information is adapted.] [2/90]
  491.  
  492. ----------------------------------------------------------------------
  493. Subject:  11)  Just what are OPEN LOOK and Motif?
  494.  
  495.     OPEN LOOK and Motif are two graphical user interfaces (GUIs). OPEN LOOK
  496. was developed by Sun with help from AT&T and many industry reviewers; Motif was 
  497. developed by the Open Software Foundation (OSF) with input from many OSF 
  498. members. 
  499.  
  500.     OPEN LOOK is primarily a user-interface specification and style-guide; 
  501. there are several toolkits which can be used to produce OPEN LOOK applications.
  502. Motif includes an API specification; the only sanctioned Motif toolkit is the 
  503. one from OSF. However, there are other toolkits which can be used to produce 
  504. programs which look and behave like OSF/Motif; one of these, Solbourne's OI, is
  505. a "virtual toolkit" which provides a common subset of OPEN LOOK and Motif, at 
  506. the user's choice.
  507.  
  508.     OPEN LOOK GUI is also the name of a product from AT&T, comprising 
  509. their OPEN LOOK Intrinsics Toolkit and a variety of applications.
  510.  
  511. [Thanks to Ian Darwin, ian@sq.com, 5/91]
  512.  
  513. ----------------------------------------------------------------------
  514. Subject:  14)  What is PEX?
  515.  
  516.     The PHiGS Extension to X is a proposed X Consortium standard awaiting 
  517. proof of concept; PHiGS stands for "Programmer's Hierarchical Interactive 
  518. Graphics System" and is essentially a library of functions that simplifies the 
  519. creation and manipulation of 3D graphics. Many platforms are capable of
  520. performing in hardware the computations involved in rendering 3D objects; the 
  521. server extension would allow the client (PHIGS in this case) to take advantage 
  522. of the specialized hardware for 3D graphics.
  523.     Sun Microsystems is currently contracted to develop a freely 
  524. redistributable (copyright similar to the current X copyright) sample
  525. implementation.  The current schedule calls for a first non-beta release of 
  526. this implementation to be available to Consortium members in early 1991 and to 
  527. the world with X11R5. Several vendors are currently selling independently-
  528. developed PEX servers for their workstations.
  529.     The current PEX document is version V5.0P, on export.lcs.mit.edu in the
  530. directory pub/PEX/.
  531. [8/90; modified 12/90]
  532.  
  533. ----------------------------------------------------------------------
  534. Subject:  15)  TOPIC: USING X IN DAY-TO-DAY LIFE
  535. ----------------------------------------------------------------------
  536. Subject:  16)  What are all these different window managers?
  537.  
  538.     The window manager in X is just another client -- it is not part of the
  539. X window system, although it enjoys special privileges -- and so there is
  540. no single window manager; instead, there are many which support different ways 
  541. for the user to interact with windows and different styles of window layout,
  542. decoration, and keyboard and colormap focus. In approximate chronological order
  543. (generally, the more recent ones are more conformant with the ICCCM):
  544.  
  545.     wm: this simple title-bar window manager was quickly phased out
  546.     uwm: the Universal Window Manager is still popular for its speed, 
  547. although it is outdated. Moved to contrib/ on the R4 tape.
  548.     twm (old): Tom's Window Manager was among the first non-MIT window 
  549. managers and offered the user a great deal of customization options in a
  550. re-parenting window manager. 
  551.     awm: the Ardent Window Manager remains a hotbed for hackers and offers
  552. some features (dynamic menus) not found on more current window managers
  553.     cwm: cwm is part of the Andrew system. Notable for being the only 
  554. window manager whose name is also an English word.
  555.     rtl: Siemen's window manager tiles windows so that they don't overlap
  556. and resizes the window with the focus to its preferred size
  557.     dxwm: Digital's dxwm is part of the DECwindows offering
  558.     hpwm: HP's window manager offers a 3D look; it is a precursor of mwm
  559.     mwm: the Motif window manager is part of the OSF/Motif toolkit
  560.     tekwm: Tektronix's window manager offering 
  561.     olwm (Sun): olwm implements the OPEN LOOK GUI and some of the Style
  562. Guide functionality
  563.     olwm (AT&T): ditto
  564.     gwm: Bull's Generic Window Manager emulates others with a built-in
  565. Lisp interpreter
  566.     m_swm: the Sigma window manager is on the R4 tape
  567.     pswm: Sun's PostScript-based pswm is part of the OpenWindows release
  568.     swm: Solbourne's swm is based on its OI toolkit and offers multiple
  569. GUI support and also a panned virtual window; configuration information comes
  570. from the resources file
  571.     twm (new): MIT's new Tab Window Manager from the R4 tape is a reworked
  572. twm and is the basis for several derivatives
  573.     vtwm: vtwm offers some of the virtual-desktop features of swm, with a
  574. single-root window implementation; it is based on the R4 twm
  575.     tvtwm: Tom's Virtual Tab Window Manager is also based on the R4 twm
  576. and provides a virtual desktop modeled on the virtual-root window of swm
  577.     olvwm: the vtwm-style virtual-desktop added to Sun's olwm
  578.     NCDwm: the window manager local to NCD terminals offers an mwm look 
  579.     XDSwm: the window manager local to Visual Technology's terminals 
  580.  
  581. [5/91]
  582.  
  583. ----------------------------------------------------------------------
  584. Subject:  17)  Why does my X session exit when I kill my window manager?
  585.  
  586.     What is probably happening is that you are running your window manager
  587. as the last job in your .xsession or .xinitrc file; your X session runs only as
  588. long as the last job is running, and so killing your window manager is 
  589. equivalent to logging out. Instead, run the window manager in the background,
  590. and as the last job instead invoke something safe like:
  591.         exec xterm -name Login -rv -iconic
  592. Your X session will continue until you explicitly logout of this window, 
  593. whether or not you kill your window manager.
  594.  
  595. ----------------------------------------------------------------------
  596. Subject:  18)  Is there a way for my WM to produce my .xinitrc, like toolplaces?
  597.  
  598.     Although no known window manager directly supports such a feature, there
  599. is a contributed application which does much of what you are looking for,
  600. although it is not as complete as the SunView program toolplaces. Look for the
  601. application "xplaces" on an archive-server near you. There are several versions
  602. of this program floating around; look for a recent vintage.
  603. [10/90]
  604.  
  605. ----------------------------------------------------------------------
  606. Subject:  19)  How do I use another window manager with DEC's session manager?
  607.  
  608.     DEC's session manager will start dxwm up by default. To override this, 
  609. add to your .Xdefaults file something like this line, naming the full pathname:
  610.     sm.windowManagerName:   /usr/bin/X11/your_favorite_wm
  611.  
  612. ----------------------------------------------------------------------
  613. Subject:  20)  How do I change the keyboard auto-repeat rate?
  614.  
  615.     You can turn auto-repeat on or off by using "xset r on|off". The X
  616. protocol, however, doesn't provide for varying the auto-repeat rate, which is
  617. a capability not supported by all systems.
  618.     Some servers running on systems that support this (the Xsun server from
  619. MIT, for example), however, may provide command-line flags to set the rate at 
  620. start-up time. If you have control over server start-up, you can invoke the
  621. server with the chosen settings. 
  622.  
  623. ----------------------------------------------------------------------
  624. Subject:  21)  How do I remap the keys on my keyboard to produce a string?
  625.  
  626.     There is no method of arranging for a particular string to be
  627. produced when you press a particular key. The xmodmap client, which is useful 
  628. for moving your CTRL and ESC keys to useful places, just rearranges keys and 
  629. does not do "macro expansion."
  630.     Some (few) clients, including xterm and several X-based editors, 
  631. accept a translation resource such as:
  632.     xterm*VT100.Translations: #override \
  633.         <Key>F1: string("setenv DISPLAY unix:0")
  634. which permits the shorthand F1 to be pressed to reset the display locally
  635. within an xterm; it takes effect for new xterm clients.
  636.     Window managers, which could provide this facility, do not yet; nor
  637. has a special "remapper" client been made available.
  638.  
  639. ----------------------------------------------------------------------
  640. Subject:  22)  How do I make a screendump of the X display?
  641.  
  642.     The xwd client in the R3 and R4 distributions can be used to select a
  643. window or the background. It produces an XWD-format file of the image of that
  644. window. The file can be post-processed into something useful or printed with 
  645. the xpr client and your local printing mechanism. You can use this command:
  646.         csh% sleep 10; xwd -root > output.xwd &
  647. and then spend 10 seconds or so setting up your screen; the entire current
  648. display will be saved into the file output.xwd. Note that xwd also has an 
  649. undocumented -id flag for specifying the window id on the command-line.
  650.  
  651.     Two publicly-available programs which allow interactive definition of 
  652. arbitrary portions of the display and built-in delays are asnap and xgrabsc.
  653. Xgrabsc was both recently [8/90] posted to comp.sources.x.
  654.     xsnap includes some asnap features and supersedes it; it also renders 
  655. XPM output. It is available on export, as well. [11/90]
  656.  
  657.     Also: some vendors' implementations of X (e.g. DECWindows and 
  658. OpenWindows 2.0) include session managers or other desktop programs which 
  659. include "print portion of screen" or "take a snapshot" options.
  660.  
  661.     Also: some platforms have tools which can be used to grab the 
  662. frame-buffer directly. The Sun systems, for example, have a 'screendump' 
  663. program which produces a Sun raster file. 
  664.  
  665.     Some vendors' implementations of lpr (e.g. Sony) include direct 
  666. support for printing xwd files, but you'll typically need some other package 
  667. to massage the output into a useful format which you can get to the printer.
  668.  
  669.     To post-process the xwd output of some of these tools, you can use xpr,
  670. which is part of the R4 distribution. Also on several archives are xwd2ps
  671. and XtoPS, which produce Encapsulated PostScript with trimmings suitable for 
  672. use in presentations (see export.lcs.mit.edu:contrib/xwd2ps.tar.Z and
  673. contrib/ImageMagick.tar.Z). Also useful is the PBMPLUS package on many archive
  674. servers.
  675.  
  676. ----------------------------------------------------------------------
  677. Subject:  23)  How do I make a color PostScript screendump of the X display?
  678.  
  679.     If you need color PostScript in particular, you can 
  680.     - grab the screen-image using xgrabsc to begin with, which can produce
  681. color PostScript.  
  682.     - grab the screen-image using xwd and post-process xwd into color PS.
  683. You can do this using xwd2ps or the XtoPS program from the ImageMagick 
  684. distribution. The PBMPLUS package is also good for this.
  685.  
  686. ----------------------------------------------------------------------
  687. Subject:  24)  How can I print the current selection?
  688.  
  689.     You could paste it into an xterm after executing the lpr command. 
  690. However, a program by Richard Hesketh (rlh2@ukc.ac.uk) specifically for 
  691. manipulating the selection will help; e.g. 
  692.     xselection PRIMARY | lpr
  693. finds the primary selection and prints it. This command can be placed in a 
  694. window-manager menu or in shell-scripts. xselection also permits the setting of
  695. the selection and other properties. It is probably available on fine 
  696. archive-servers everywhere.
  697.     Also available is ria.ccs.uwo.ca:pub/xget_selection.tar.Z, which can be
  698. adapted to do this.
  699.  
  700. ----------------------------------------------------------------------
  701. Subject:  25)  Why are my xterm menus so small?
  702.  
  703.     You are probably setting the geometry small accidentally. If you give 
  704. a resource specification like this:
  705.         xterm*geometry: 80x24
  706. then you are asking for all widgets under xterm to have their geometry set to
  707. 80x24. For the main window, this is OK, as it uses characters for its size. 
  708. But its popup menus don't; they are in pixels and show up small. To set only
  709. the terminal widget to have the specified geometry, name it explicitly:
  710.         xterm*VT100.geometry: 80x24
  711.  
  712. ----------------------------------------------------------------------
  713. Subject:  26)  Where can I find a dictionary server for xwebster?
  714.  
  715.     Webster's still owns the copyright to the on-line copies of Webster's
  716. Dictionary which are found at various (university) sites. After it became aware
  717. that these sites were then acting as servers for other sites running xwebster 
  718. and gnuemacs-webster, it asked that server sites close off external access.
  719.     [The NeXT machine apparently is also licensed to have the dictionary. A
  720. Webster daemon for NeXT machines is available from uvax.cs.indiana.edu 
  721. (129.79.254.192) in "pub/webster/NeXT-2.0".]
  722.     Unless you want to get a legal on-line copy yourself or can find a site
  723. which can grant you access, you are probably out of luck. 
  724.  
  725.     However, if you are a legitimate site, you'll want to pick up the
  726. latest xwebster, as-is on export:contrib/xwebster.tar.Z [11/90]; the file 
  727. xwebster.README includes discussions of the availability, illegality, and 
  728. non-availability of dictionary servers. 
  729.     
  730. [courtesy steve@UMIACS.UMD.EDU (Steve Miller) and mayer@hplabs.hp.com (Niels 
  731. Mayer) 11/90]
  732.  
  733. ----------------------------------------------------------------------
  734. Subject:  27)  How do I convert/view Mac/TIFF/GIF/Sun/PICT/img/FAX images in X?
  735.  
  736.     The likeliest program is an incarnation of Jef Poskanzer's useful++ 
  737. Portable Bitmap Toolkit, which includes a number of programs for converting 
  738. among various image formats. It includes support for many types of bitmaps, 
  739. gray-scale images, and full-color images. PBMPLUS has been updated since it was
  740. posted to the net about 11/22/89 and is also more recent than the one on the 
  741. R4 tape under contrib/clients/pbmplus. The current version is in "active beta"
  742. [3/91] on export:/contrib/pbmplus.tar.Z. 
  743.     The package has been independently updated to support XPM images for
  744. pixmaps. There are also several patches to various modules floating around.
  745.  
  746.     Useful for viewing some image-formats is Jim Frost's xloadimage, a
  747. version of which is in the R4 directory contrib/clients/xloadimage -- there
  748. are later versions available; version 3.0.1 shipped 5/91 and is on export
  749. /contrib/xloadimage.3.01.tar.Z.
  750.  
  751.     An alternate image-viewer is xv (X Image Viewer), written by 
  752. bradley@halibut.cis.upenn.edu (John Bradley) and distributed as comp.sources.x 
  753. Volume 10:79. It is also on export as xv.pl3.tar.Z. XV displays many image
  754. formats and permits editing of GIF files, among others. [12/90]
  755.  
  756.     The Fuzzy Pixmap Manipulation, by Michael Mauldin <mlm@nl.cs.cmu.edu>.
  757. Conversion and manipulation package, similar to PBMPLUS.  Version 1.0 available
  758. via FTP as nl.cs.cmu.edu:/usr/mlm/ftp/fbm.tar.Z, uunet.uu.net:pub/fbm.tar.Z, 
  759. and ucsd.edu:graphics/fbm.tar.Z.
  760.  
  761.     The Img Software Set, by Paul Raveling <raveling@venera.isi.edu>, reads
  762. and writes its own image format, displays on an X11 screen, and does some image
  763. manipulations.  Version 1.3 is available via FTP on expo.lcs.mit.edu as
  764. contrib/img_1.3.tar.Z, along with large collection of color images.
  765.  
  766.     Xim, by Philip R. Thompson, reads and writes its own image format,
  767. displays on an X11 screen, and does some image manipulations.  Available in 
  768. your nearest X11R4 source tree as contrib/clients/xim.  A more recent version 
  769. is available via ftp from video.mit.edu.  It uses x11r4 and the OSF/Motif 
  770. toolkit to provide basic interactive image manipulation and reads/writes GIF, 
  771. xwd, xbm, tiff, rle, xim, and other formats.
  772.  
  773.     ImageMagick by cristy@dupont.com can be retrieved as the file 
  774. contrib/ImageMagick.tar.Z (no patch level) from export.lcs.mit.edu.  It is a 
  775. collection of utilities to transform and display images on any X server. The
  776. tool uses the MIFF format; filters to and from MIFF from other popular formats 
  777. (PPM, TIFF, GIF, SUN Raster, etc) are included.
  778.  
  779.     xtiff is a tool for viewing a TIFF file in an X window.  It was written
  780. to handle as many different kinds of TIFF files as possible while remaining
  781. simple, portable and efficient.  xtiff illustrates some common problems
  782. with building pixmaps and using different visual classes.  It is distributed
  783. as part of Sam Leffler's libtiff package and it is also available on
  784. export.lcs.mit.edu, uunet.uu.net and comp.sources.x. [dbs@decwrl.dec.com, 10/90]
  785. xtiff 2.0 was announced in 4/91; it includes Xlib and Xt versions.
  786.  
  787.     An alpha version of Lee Iverson's (leei@McRCIM.McGill.EDU) image-viewing
  788. *widget* is available as /contrib/vimage.tar.Z on export.lcs.mit.edu and in 
  789. /pub/maspar on moe.mcrcim.mcgill.edu. [5/91] Look for patches, too. [6/91]
  790.  
  791. [some material from Larry Carroll (larryc@poe.jpl.nasa.gov), 5/91]
  792.  
  793. ----------------------------------------------------------------------
  794. Subject:  28)  How can I change the titlebar of my xterm window?
  795.  
  796.     The solution involves sending an escape sequence to xterm which will
  797. cause it to update the property which the window manager relies upon for the
  798. string which appears in the window titlebar.
  799.     A solution is as easy as typing this in an xterm running a shell:
  800.         echo "ESC]2;TEXT^G"
  801. where ESC is the escape key, TEXT is the string you wish to have displayed,
  802. and ^G is a Control-G (the BEL character).
  803.  
  804.     Here is a more complicated csh alias which changes the titlebar to
  805. the current working directory when you change directories:
  806.         alias newcd 'cd \!* ; echo ESC]2\;$cwd^G'
  807.  
  808.     The digit '2' in these strings indicates to xterm that it should 
  809. change only the title of the window; to change both the title and the name 
  810. used in the icon, use the digit '0' instead, and use '1' to change only the 
  811. icon name.
  812.  
  813.     These sequences work for both R3 and R4 xterm windows; the R4 xterm,
  814. however, does not accept the looser sequences which worked under R3 and
  815. demands a semicolon, above, for example, where the R3 xterm allowed any
  816. character.
  817.  
  818.     Note: another way to do this, which prevents an incorrect display of
  819. the local directory if a modified `cd` is used in a subshell, is to wrap the
  820. escape sequences into the PS1 prompt itself.
  821.  
  822. ----------------------------------------------------------------------
  823. Subject:  29)  Where can I find the xterm control sequences? [edited]
  824.  
  825. The best source of such information is the file mit/clients/xterm/ctlseqs.ms.
  826.  
  827. This document is not installed as part of the installation.
  828.  
  829. In a pinch, a VT100 manual will do.
  830.  
  831. ----------------------------------------------------------------------
  832. Subject:  30)  How do I keep my $DISPLAY when I rlogin to another machine?
  833.  
  834.     There are several ways to avoid having to do a "setenv DISPLAY ..."
  835. whenever you log in to another networked UNIX machine running X.
  836.     One solution is to use the xrlogin program from der Mouse
  837. (mouse@larry.mcrcim.mcgill.edu). You can ftp caveat-emptor versions from
  838. 132.206.1.1, in X/xrlogin.c and X/xrlogind.c. The program packages up $TERM and
  839. $DISPLAY into a single string, which is stuffed into $TERM.  rlogin then 
  840. propagates $TERM normally; your .cshrc on the remote machine should contain
  841.         eval `xrlogind`
  842. where xrlogind is a program that checks $TERM and if it is of the special 
  843. format it recognizes, unpacks it and spits out setenv and unsetenv commands to 
  844. recreate the environment variables. [11/90]
  845.  
  846.     In addition, if all you need to do is start a remote X process on 
  847. another host, and you find
  848.         rsh <HOST> -n /usr/bin/X11/xterm -display $DISPLAY 
  849. too simple (DISPLAY must have your real hostname), then this version of xrsh 
  850. can be used to start up remote X processes. The equivalent usage would be 
  851.         xrsh <HOST> xterm
  852.  
  853.   #! /bin/sh
  854.   # start an X11 process on another host
  855.   # Date: 8 Dec 88 06:29:34 GMT
  856.   # From: Chris Torek <chris@mimsy.umd.edu>
  857.   # rsh $host -n "setenv DISPLAY $DISPLAY; exec $@ </dev/null >&/dev/null"
  858.   #
  859.   # An improved version:
  860.   # rXcmd (suggested by John Robinson, jr@bbn.com)
  861.   #       (generalized for sh,ksh by Keith Boyer, keith@cis.ohio-state.edu)
  862.   #
  863.   # but they put the rcmd in ()'s which left zombies again.  This
  864.   # script combines the best of both.
  865.   
  866.   case $# in
  867.   [01])  echo "Usage: $0 host x-cmd [args...]";;
  868.   *)
  869.       case $SHELL in
  870.       *csh*)  host="$1"; shift
  871.           xhost "$host" > /dev/null
  872.           rsh "$host" -n \
  873.               "setenv TERM xterm; setenv DISPLAY `hostname`:0; \
  874.               exec $* </dev/null >& /dev/null" &
  875.           ;;
  876.       *sh)
  877.           host="$1"; shift
  878.           xhost "$host" > /dev/null
  879.           rsh "$host" -n \
  880.               "TERM=xterm export TERM; \
  881.               DISPLAY=`hostname`:0 export DISPLAY; \
  882.               LD_LIBRARY_PATH=/usr/X11/lib export LD_LIBRARY_PATH; \
  883.               PATH=\$PATH:/usr/X11/bin:/usr/bin/X11:/usr/local/bin; \            export PATH; \
  884.               exec $* < /dev/null > /dev/null 2>&1" &
  885.           ;;
  886.       esac
  887.       ;;
  888.   esac
  889.  
  890. ----------------------------------------------------------------------
  891. Subject:  31)  How can I design my own font?
  892.  
  893.     One way is to use the "bitmap" client or some other bitmap-editor (e.g.
  894. Sun's icon-editor tool, post-processed with pbmplus) to design the individual 
  895. characters and then to do some large amount of post-processing to concatenate 
  896. them into the BDF format.
  897.     The R3 contrib/ area (in fonts/utils/ and in clients/xtroff) contained 
  898. a number of useful utilities, including some to convert between BDF font format
  899. and a simple character format which can be edited with any text editor.
  900.     An easier way is to use the "xfed" client to modify an existing font; a
  901. recent version is on the R4 tape in contrib/clients/xfed. Xfed is available for
  902. anonymous ftp on unido.informatik.uni-dortmund.de (129.217.64.60) as file 
  903. /pub/windows/X/Diverse-X11-Sourcen/xfed.tar.Z.
  904.     The xfedor client from Group Bull permits creation of bitmaps, cursors,
  905. XPM1 pixmaps, and fonts. Binaries for common machines are on 
  906. avahi.inria.fr/pub; in addition, the sources, with plenty of caveats, have been
  907. placed [5/91] in export:/contrib. 
  908.     If you are a MetaFont user you can use "mftobdf" from the SeeTeX
  909. distribution to convert PK, GF, and PXL fonts to BDF format; the distribution
  910. is on foobar.colorado.edu and on export.lcs.mit.edu.
  911.  
  912. ----------------------------------------------------------------------
  913. Subject:  32)  Why does adding a font to the server not work?
  914.  
  915.     After you have built the font using your system's font-compiler, 
  916. installed it in some directory, and run `mkfontdir` or your system's equivalent
  917. in that directory, be sure to use `xset +fp $dir` to add that full path-name to
  918. the server's font-path, or if the directory is already in the path, use 
  919. `xset fp rehash` so that the new fonts in that directory are actually found; it
  920. is this last step that you're probably leaving out.
  921.  
  922. ----------------------------------------------------------------------
  923. Subject:  33)  How do I convert a ".snf" font back to ".bdf" font?
  924.  
  925.     A tool called "snftobdf 1.4" is part of the bdftools package, which is 
  926. available from export.lcs.mit.edu:contrib/bdftools.tar.Z and from 
  927. crl.nmsu.edu:pub/misc/bdftools.tar.Z. Sources have been posted to fj.sources on
  928. JUNET and should be appearing on comp.sources.x. [2/91]
  929.  
  930. ----------------------------------------------------------------------
  931. Subject:  34)  What is a general method of getting a font in usable format?
  932.  
  933.     der Mouse's getbdf is one solution; it connects to a server and 
  934. produces a .BDF file for any font the server is willing to let it.  It can be 
  935. used as an anything-to-BDF converter, but requires access to a server that can 
  936. understand the font file, thus is both more and less powerful than other tools 
  937. such as snftobdf. getbdf is on 132.206.1.1 in X/getbdf.c or available via mail 
  938. from mouse@lightning.McRCIM.McGill.EDU. [5/91]
  939.  
  940. ----------------------------------------------------------------------
  941. Subject:  35)  How do I use HP ".scf" fonts on my MIT R4 server?
  942.  
  943.     The X server from HP uses fonts whose names have the .scf suffix. These
  944. are just compressed .snf fonts which are produced with the normal bdftosnf 
  945. program.  You should be able to uncompress the font and add it to your font 
  946. area, possibly with a rename to .snf. Remember to run mkfontdir and to rehash
  947. the font path.
  948.  
  949. ----------------------------------------------------------------------
  950. Subject:  36)  How do I use DECwindows ".pcf" fonts on my MIT R4 server?
  951.  
  952.     The DECwindows server stores fonts in a ".pcf" format which is not
  953. recognized by the X11R4 server. There are several "font extractor" tools that 
  954. you can use to get the .pcf files from the DEC server and write the information
  955. to a .bdf file, which you can then recompile to .snf fonts using the 
  956. font-compiler from the MIT distribution; the bdftools package is reported to
  957. contain such an extractor.
  958.  
  959. ----------------------------------------------------------------------
  960. Subject:  37)  How do I use DECwindows fonts on my non-DECwindows server?
  961.  
  962.     The DECwindows fonts typically don't exist on a non-DEC installation,
  963. but rewrite rules can be used to alias fonts used by DECwindows applications to
  964. standard MIT fonts of similar characteristics and size. Pick up the file 
  965. contrib/DECwindows_on_X11R4_font.aliases from export.lcs.mit.edu; this file is 
  966. for a standard MIT R4 server.  It can also serve as a starting point for 
  967. creating a similar aliases file for the Open Windows server or other servers 
  968. which do not use the MIT font scheme.
  969.  
  970. ----------------------------------------------------------------------
  971. Subject:  38)  How do I add ".bdf" fonts to my DECwindows server?
  972.  
  973.     The format of fonts preferred by DEC's X server is the ".pcf" format.
  974. You can produce this compiled format from the .bdf format by using DEC's dxfc
  975. font-compiler. Note that the DEC servers can also use raw .bdf fonts, with a
  976. performance hit.
  977.  
  978. ----------------------------------------------------------------------
  979. Subject:  39)  Why can't I set the backgroundPixmap resource in a defaults file?
  980. I want to be able to do something like this:
  981.     xclock*backgroundPixmap:      /usr/include/X11/bitmaps/rootweave
  982.  
  983.     You can't do this. The backgroundPixmap resource is a pixmap of the 
  984. same depth as the screen, not a bitmap (which is a pixmap of depth 1). Because 
  985. of this, writing a generic String to Pixmap converter is impossible, since 
  986. there is no accepted convention for a file format for pixmaps. Therefore, 
  987. neither the X Toolkit or the Athena widget set define a String to Pixmap 
  988. converter, because there is no converter you cannot specify this value as a 
  989. resource.  The Athena widget set does define a String to Bitmap converter for 
  990. use in many of its widgets, however.
  991. [courtesy Chris D. Peterson (now kit@ics.com), 4/90]
  992.  
  993. However:
  994.     A specific converter which encapsulates much of the functionality of the
  995. xloadimage package by Jim Frost was posted 12/90 by Sebastian Wangnick 
  996. (basti@unido.informatik.uni-dortmund.de); it permits loading of a number of 
  997. image formats as a pixmap.
  998.  
  999.     The leading general-purpose format for pixmaps is the XPM format used 
  1000. by Groupe Bull in several of its programs, including the GWM window manager, by
  1001. AT&T in its olpixmap editor, and by ICS in its interface builder. XPM 
  1002. distribution, available on export as contrib/xpm.tar.Z, includes read/write 
  1003. routines which can easily be adapted to converters by new widgets which want to
  1004. allow specification of pixmap resources in the above manner.  See information
  1005. on the xpm-talk mailing list above. XPM 3.0a was announced in 4/91 and is
  1006. available from export.lcs.mit.edu and avahi.inria.fr.
  1007.  
  1008. ----------------------------------------------------------------------
  1009. Subject:  40)  Why does the R3 xterm, et al, fail against the R4 server?
  1010.  
  1011.     The value given to a window's do_not_propagate mask is the likely 
  1012. culprit.  R3 allowed bogus values to be set, and early version of both Andrew 
  1013. and Interviews did, as well. Similar problems also occur in the R3 Motif
  1014. PanedWindow widget.
  1015.     If it is impossible to fix client source, use 'xset bc' to put the 
  1016. X11R4 server into bug-compatibility mode.
  1017.  
  1018. ----------------------------------------------------------------------
  1019. Subject:  42)  How can I have xclock or oclock show different timezones?
  1020.  
  1021.     One solution is xchron, in Volume 6 of comp.sources.x, which can show
  1022. the time for timezones other than the local one. 
  1023.     Alternatively, you can probably set the timezone in the shell from
  1024. which you invoke the xclock or oclock, or use a script similar to this:
  1025.     #!/bin/sh
  1026.     TZ=PST8PDT xclock -name "San Jose" 2> /dev/null &
  1027.     TZ=EST5EDT xclock -name "Cambridge" 2> /dev/null &
  1028.  
  1029. ----------------------------------------------------------------------
  1030. Subject:  43)  I have xmh, but it doesn't work. Where can I get mh?
  1031.  
  1032.     The xmh mail-reader requires the Rand mh mail/message handling system,
  1033. which is not part of the UNIX software distribution for many machines. The
  1034. current version of mh is typically on ics.uci.edu in /mh; it was updated in
  1035. mid-December 1990 to 6.7.1. [1/91]
  1036.  
  1037. ----------------------------------------------------------------------
  1038. Subject:  44)  Why am I suddenly unable to connect to my Sun X server?
  1039. After a seemingly random amount of time after the X server has been started, no
  1040. other clients are able to connect to it.
  1041.  
  1042.     The default cron cleanup jobs supplied by Sun (for 4.0.3, at least)
  1043. delete "old" (unreferenced) files from /tmp -- including /tmp/.X11-unix, which 
  1044. contains the socket descriptor used by X. The solution is to add "! -type s" to
  1045. the find exclusion in the cron job.
  1046. [10/90]
  1047.  
  1048. ----------------------------------------------------------------------
  1049. Subject:  45)  Why can't I override translations? Only the first item works.
  1050.  
  1051.     You probably have an extra space after the specification of the first 
  1052. item, like this:
  1053.     basic*text.translations:  #override \
  1054.     Ctrl<Key>a:    beginning-of-line() \n\     
  1055.     Ctrl<Key>e:    end-of-line()
  1056.                           ^ extra space
  1057. The newline after that space is ending the translation definition.
  1058. [Thanks to Timothy J. Horton, 5/91]
  1059.  
  1060. ----------------------------------------------------------------------
  1061. Subject:  46)  How do I report bugs in X?
  1062.  
  1063.     Generally, report bugs you find to the organization that supplied you
  1064. with the X Window System. If you received the source distribution directly from
  1065. MIT, please read the file mit/doc/bugs/bug-report for instructions (see also 
  1066. "getting patches for R4", below).
  1067.  
  1068. ----------------------------------------------------------------------
  1069. Subject:  47)  TOPIC: OBTAINING X AND RELATED SOFTWARE AND HARDWARE
  1070. ----------------------------------------------------------------------
  1071. Subject:  48)  Is X public-domain software?
  1072.  
  1073.     No. The X software is copyrighted by various institutions and is not 
  1074. "public domain", which has a specific legal meaning. However, the X 
  1075. distribution is available for free and can be redistributed without fee.
  1076.     Contributed software, though, may be placed in the public domain by
  1077. individual authors.
  1078.  
  1079. ----------------------------------------------------------------------
  1080. Subject:  56)  Where can I obtain other X sources?
  1081.  
  1082.     User-contributed software is distributed through the newsgroup
  1083. comp.sources.x, moderated by Dan Heller (argv@sun.com); also check that group 
  1084. for posting information.
  1085.  
  1086.     Richard Hesketh (rlh2@ukc.ac.uk) has been creating a list of freely-
  1087. available X sources.  The list is stored on export.lcs.mit.edu in contrib as
  1088. x-source-list.Z. It lists the main storage locations for the program and 
  1089. international sites from which it may be ftp'ed.
  1090.  
  1091.     The machine export.lcs.mit.edu has a great deal of user-contributed
  1092. software in the contrib/ directory; a good deal of it is present in current or 
  1093. earlier versions on the X11R3 and X11R4 contrib tapes. There is a new directory
  1094. contrib/R4fixes/ for fixes to R4 contrib software. [Jim Fulton, 2/90]
  1095.  
  1096.     The material on giza.cis.ohio-state.edu, which tends to duplicate 
  1097. the export archives, is also available via anonymous UUCP from osu-cis, at TB+ 
  1098. and V.32 speeds.  Write to uucp@cis.ohio-state.edu (same as osu-cis!uucp) for 
  1099. instructions. [the archive is now maintained by Karl Kleinpaste]
  1100.  
  1101.     A new west-coast UUCP X11 Archive is administered by Mark Snitily 
  1102. (mark@zok.uucp) and contains the full X11R4 distribution, the XTEST
  1103. distribution, an entire archive of comp.sources.x and other goodies.
  1104.     The machine zok has a TB+ modem which will connect to 19.2K, 2400, 
  1105. 1200 baud (in that order).  The anonymous UUCP account is UXarch with password 
  1106. Xgoodies.  The modem's phone number is 408-996-8285.
  1107.     A sample Systems (or L.sys) entry might be:
  1108.            zok Any ACU 19200 4089968285 in:--in: UXarch word: Xgoodies
  1109.     To get a current listing of the files that are available, download
  1110. the file "/usrX/ls-lR.Z".
  1111.     A full subject index of the comp.sources.x files is available in the
  1112. file "/usrX/comp.sources.x/INDEX".
  1113.     The machine has just the one modem, so please do not fetch large 
  1114. amounts of data at one sitting.
  1115. [courtesy Mark Snitily, 2/90]
  1116.  
  1117.  
  1118. FTP sites and software available:
  1119. This list is a lightly-edited (e.g. `grep X`) condensation of sites posted by
  1120. odin@pilot.njin.net (Jon Granrose) [9/90].
  1121.  
  1122. a.cs.uiuc.edu                      128.174.252.1   TeX, dvi2ps, gif, texx2.7
  1123. avahi.inria.fr                     192.5.60.47     xfedor
  1124. brazos.rice.edu                    128.42.42.2     pub/X11R3/core.src
  1125. cayuga.cs.rochester.edu            192.5.53.209    Xfig, JOVE, NL-KR mail list
  1126. cheddar.cs.wisc.edu                128.105.2.143   Common Lisp stuff, X11
  1127. crl.dec.com                        192.58.206.2    X11R4
  1128. cs.toronto.edu                     128.100.1.65    UofT BIND, X applications
  1129. dinorah.wustl.edu                  128.252.118.101 X11R3/core.src, portability
  1130. dolphin.mit.edu                    18.86.0.5       X11r3 device driver for S,
  1131. emil.csd.uu.se                     130.238.4.2     Old GNU, X R10
  1132. export.lcs.mit.edu                 18.30.0.238     X, portable bitmaps, CLX and
  1133.  export.lcs.mit.edu                                  CLUE, gwm
  1134. extro.ucc.su.oz.au                 129.78.64.1     images, gnu, icon, kermit,
  1135.  extro.ucc.su.oz.au                                Ghostscript patches
  1136. faui43.informatik.uni-erlangen.de  131.188.1.43    NeWS X11 amiga atari faces
  1137. fcs280s.ncifcrf.gov                129.43.1.11     xtrek5.4
  1138. finsun.csc.fi                      128.214.46.40   X11R4 ftp-list
  1139. foobar.colorado.edu                128.138.243.105 BDF fonts, xtex
  1140. freja.diku.dk                      129.142.96.1    nn, gnu, x11r4, tex, isode
  1141. fresnel.stanford.edu               36.10.0.77      X11R4 for Iris
  1142. gatekeeper.dec.com                 16.1.0.2        X11, recipes, cron, map
  1143. giza.cis.ohio-state.edu            128.146.8.61    X, PEX
  1144. hemuli.tik.vtt.fi                  130.188.52.2    WorldMap X bind.4.8 finger
  1145. hpcvaaz.cv.hp.com                  15.255.72.15    MitX11R4 Motif
  1146. hpserv1.uit.no                     128.39.60.50    HP stuff, X11, unix, etc
  1147. hydra.helsinki.fi                  128.214.4.29    misc, TeX, X
  1148. interviews.stanford.edu            36.22.0.175     InterViews X toolkit
  1149. iraun1.ira.uka.de                  129.13.10.90    GNU X11 comp.sources.unix
  1150. irisa.irisa.fr                     131.254.2.3        comp.sources.x
  1151.  j.cc.purdue.edu                   128.210.5.1     comp.sources.x
  1152. jpl-mil.jpl.nasa.gov               128.149.28.2    TeX, mac, GNU, X11R2, X11R3
  1153. kappa.rice.edu                     128.42.4.7      X11R3, GNU for Sequent S27
  1154. labrea.stanford.edu                36.8.0.47       GNU, X, official TeX sources
  1155. larry.mcrcim.mcgill.edu            132.206.4.3     RFCs, X, local nameserver
  1156. lll-crg.llnl.gov                   128.115.1.1     X11R4
  1157. ltisun.epfl.ch                     128.178.38.6    xconq
  1158. m9-520-1.mit.edu                   18.80.0.45      xim utils
  1159. maddog.llnl.gov                    128.115.10.1    AWM X tutorial, PCP
  1160. mcs213k.cs.umr.edu                 131.151.6.11    xgif, shuttle
  1161. me10.lbl.gov                       128.3.128.110   X11 binaries for hp-ux, me10
  1162. nic.funet.fi                       128.214.6.100   GNU, X11, networking, msdos,
  1163. oddput.efd.lth.se                  130.235.48.4    xps (postscript previewer)
  1164. peace.waikato.ac.nz                130.217.64.62   x11r4
  1165. polyslo.calpoly.edu                129.65.17.1     xtrek, top 2.0, spaceout,
  1166. qed.rice.edu                       128.42.4.38     GNU, X11R3, plot2ps sources
  1167. research.att.com                   192.20.225.2    TeX, gcc, ghostscript, f2c
  1168. scam.berkeley.edu                  128.32.138.1    X sources, etc.
  1169. schizo.samsung.com                 134.228.1.2     comp.sources.x
  1170. sequent.kent.edu                   131.123.2.50    x11r4 for esix
  1171. shambhala.berkeley.edu             128.32.132.54   xrn, xgraph
  1172. shemp.cs.ucla.edu                  131.179.128.34  XWIP
  1173. sirius.ucs.adelaide.edu.au         129.127.40.3    X11R4
  1174. slug.pws.bull.com                  128.35.10.203   comp.sources.x, gif, X11R4,
  1175.  slug.pws.bull.com                                 X11R3, R4contrib, gnu,
  1176. ti.com                             128.247.159.141 CLX
  1177. trout.nosc.mil                     132.249.16.12   X11R3, benchmarks, popd, GNU
  1178. ucbvax.berkeley.edu                128.32.130.12   nntp, gnews, awm, empire
  1179. unido.informatik.uni-dortmund.de   129.217.64.60   atari, mac, benchmarks,
  1180.  unido.informatik.uni-dortmund.de                  utils, x11, sysadm tools
  1181. vaxa.isi.edu                       128.9.0.33      clf-act, X, db
  1182. winnie.princeton.edu               128.112.128.180 music software (unix & NeXT)
  1183.  wpi.wpi.edu                                       TeX_DS3100, TeX_Umax, misc X
  1184. wuarchive.wustl.edu                128.252.135.4   GNU, X.11R3, GIF, IEN, RFCs,
  1185.  wuarchive.wustl.edu                               comp.sources.x, msdos,
  1186. xanth.cs.odu.edu                   128.82.8.1      comp.sources.x,
  1187.  xanth.cs.odu.edu                  128.82.4.1      comp.sources.games, X10R4
  1188. xview.ucdavis.edu                  128.120.1.150   xview
  1189.  
  1190. These sites mirror export and are of particular use for Australasia:
  1191.     Anonymous ftp: ftp.Adelaide.EDU.AU      pub/X/R4/
  1192.                         pub/sources/x/
  1193.     ACSnet Fetchfile: sirius.ua.oz          X/R4/
  1194.                         sources/x/
  1195.  
  1196. In addition, UUNET Source Archives (703-876-5050) tracks comp.sources.x and 
  1197. provides 800MB+ of compressed programs on 6250 bpi tapes or 1/4" tapes
  1198. (or Exabyte 8mm cartridges?).
  1199.     
  1200. ----------------------------------------------------------------------
  1201. Subject:  57)  Where can I obtain interesting widgets?
  1202.  
  1203.     The Free Widget library sponsored by Brian Totty (totty@cs.uiuc.edu) is
  1204. now [12/90] available on a.cs.uiuc.edu (128.174.252.1) in pub/fwf.shar.Z. The 
  1205. set of widgets there is intended to form the basis for future contributions. To
  1206. be added to the discussion list, contact free-widgets-request@ 
  1207. eagle.cnsf.cornell.edu. The current set includes a pixmap editor.
  1208.     Additional widgets are available on the contrib/ portion of the X11R4
  1209. tapes; these include the Xcu set.
  1210.     O'Reilly Volume 4, Doug Young's book, the Asente/Swick book, and Jerry 
  1211. Smith's "Object-oriented Programming with the X Window System Toolkits" all 
  1212. include details on writing widgets and include several useful widgets; sources 
  1213. are typically on export and/or UUNET. 
  1214.     The Dirt interface builder includes the libXukc widet set which extends
  1215. the functionality of Xaw. 
  1216.     A graph widget and other 2D-plot and 3D-contour widgets by Sundar 
  1217. Narasimhan (sundar@ai.mit.edu) are available from ftp.ai.mit.edu as
  1218. /com/ftp/pub/users/sundar/graph.tar.Z. The graph widget has been updated [3/91]
  1219. with documentation and histogram capabilities.
  1220.     Ken Lee's Xm widget (beta) that uses Display PostScript to draw labels 
  1221. at a non-horizontal angle is on export in contrib/dpslabel.tar.Z.
  1222.  
  1223.     An alpha version of Lee Iverson's (leei@McRCIM.McGill.EDU) image-viewing
  1224. *widget* is available as /contrib/vimage.tar.Z on export.lcs.mit.edu and in 
  1225. /pub/maspar on moe.mcrcim.mcgill.edu. The package also includes an 
  1226. ImageViewPort widget and a FileDialog widget. [5/91] 
  1227.     Other available file-requestor widgets include the FileSelector from the
  1228. Free Widget Foundation, the XiFileSelector from Iris Software's book, and
  1229. the xdbx file-selector extracted by David Nedde (daven@wpi.wpi.edu).
  1230.  
  1231. ----------------------------------------------------------------------
  1232. Subject:  58)  Where can I obtain alternate language bindings to X?
  1233.  
  1234.     Versions of the CLX Lisp bindings are part of the X11R3 and X11R4 core 
  1235. source distributions. The latest version of CLX (R4.5) is available from export 
  1236. for ftp as contrib/CLX.R4.5.tar.Z. [6/91]
  1237.  
  1238.     Ada bindings were written by Mark Nelson and Stephen Hyland at SAIC 
  1239. for the DOD. The bindings can be found on hapo.sei.cmu.edu or on 
  1240. wsmr-simtel20.army.mil and are also in the Ada Software Repository (ASR). 
  1241. R3 bindings should be available by the end of 1/90. [1/90]
  1242.  
  1243.     Prolog bindings (called "XWIP") written by Ted Kim at UCLA while
  1244. supported in part by DARPA are available by anonymous FTP from
  1245. export.lcs.mit.edu:contrib/xwip.tar.Z or ftp.cs.ucla.edu:pub/xwip.tar.Z.
  1246. These prolog language bindings depend on having a Quintus-type foreign function
  1247. interface in your prolog. The developer has gotten it to work with Quintus and 
  1248. SICStus prolog. Inquiries should go to xwip@cs.ucla.edu. [3/90]
  1249.  
  1250.     GHG is developing X bindings and a complete Ada re-implementation
  1251. of X; check Lionel Hanley at 713-488-8806. [4/90]
  1252.  
  1253.     Ada bindings to Motif, explicitly, will eventually be made available by
  1254. the Jet Propulsion Laboratories, probably through the normal electronic
  1255. means.  Advance information can be obtained from dsouleles@dsfvax.jpl.nasa.gov,
  1256. who may respond as time permits.
  1257.     Another set of bindings for Motif 1.1 is being done by the University of
  1258. Lowell; it can be ftp'ed from 129.63.1.1 as Motif1.1-g++.tar.Z in 
  1259. graphics/MotifC++. A Technical Report on the binding is included. [4/91]
  1260.  
  1261. ----------------------------------------------------------------------
  1262. Subject:  59)  What is the xstuff mail-archive?
  1263.  
  1264.     The xstuff server is a mail-response program. That means that you mail 
  1265. it a request, and it mails back the response.
  1266.     Any of the four possible commands must be the first word on a line. The 
  1267. xstuff server reads your entire message before it does anything, so you can 
  1268. have several different commands in a single message (unless you ask for help). 
  1269. The xstuff server treats the "Subject:" header line just like any other line 
  1270. of the message.
  1271.     The archives are organized into a series of directories and 
  1272. subdirectories.  Each directory has an index, and each subdirectory has an 
  1273. index. The top-level index gives you an overview of what is in the 
  1274. subdirectories, and the index for each subdirectory tells you what is in it.
  1275.  
  1276.     1) The command "help" or "send help" causes the server to send you a 
  1277. more detailed version of this help file.
  1278.     2) if your message contains a line whose first word is "index", then 
  1279. the server will send you the top-level index of the contents of the archive. If
  1280. there are other words on that line that match the name of subdirectories, then 
  1281. the indexes for those subdirectories are sent instead of the top-level index. 
  1282. For example, you can say "send index fixes" (or "index fixes"). A message that 
  1283. requests an index cannot request data.
  1284.     3) if your message contains a line whose first word is "send", then the
  1285. xstuff server will send you the item(s) named on the rest of the line. To name 
  1286. an item, you give its directory and its name. For example
  1287.                 send fixes 1 3 4
  1288.     You may issue multiple send requests. The xstuff server contains many 
  1289. safeguards to ensure that it is not monopolized by people asking for large 
  1290. amounts of data. The mailer is set up so that it will send no more than a fixed 
  1291. amount of data each day. If the work queue contains more requests than the 
  1292. day's quota, then the unsent files will not be processed until the next day. 
  1293. Whenever the mailer is run to send its day's quota, it sends the requests out 
  1294. shortest-first.
  1295.     4) Some mailers produce mail headers that are unusable for extracting 
  1296. return addresses.  If you use such a mailer, you won't get any response.  If 
  1297. you happen to know an explicit path, you can include a line like
  1298.         path foo%bar.bitnet@mitvma.mit.edu
  1299. or
  1300.         path bar!foo!frotz
  1301. in the body of your message, and the daemon will use it.
  1302.  
  1303.     The xstuff server itself can be reached at xstuff@expo.lcs.mit.edu. If 
  1304. your mailer deals in "!" notation, try sending to 
  1305. {someplace}!mit-eddie!expo.lcs.mit.edu!xstuff.
  1306.  
  1307. [based on information from the MIT X Consortium, 8/89, 4/90.]
  1308.  
  1309. ----------------------------------------------------------------------
  1310. Subject:  67)  Where can I get an "X terminal" server for my low-end Sun 3/50?
  1311.  
  1312.     Seth Robertson (seth@ctr.columbia.edu) has written Xkernel; the current
  1313. version [1.2 gamma as of 3/91, 2.0 expected RSN] is on sol.ctr.columbia.edu 
  1314. [128.59.64.40] in /pub/Xkernel.gamma. It turns a Sun 3/50 into a pseudo- X 
  1315. terminal; most of the overhead of the operating system is side-stepped, so it 
  1316. is fairly fast and needs little disk space.
  1317.     A similar approach is to run the regular X server by making /etc/init
  1318. a shell script which does the minimal setup and then invokes Xsun, like this
  1319. script from mouse@lightning.mcrcim.mcgill.EDU:
  1320.  
  1321. #! /bin/sh
  1322. exec >/dev/console 2>&1
  1323. /etc/fsck -p /dev/nd0
  1324. case $? in
  1325.      0)    ;;
  1326.      4)    /etc/reboot -q -n
  1327.          ;;
  1328.      8)    echo ND fsck failed - get help
  1329.          /etc/halt
  1330.          ;;
  1331.      12)    echo Interrupted
  1332.          /etc/reboot
  1333.          ;;
  1334.      *)    echo Unknown error in reboot fsck - get help
  1335.          /etc/halt
  1336.          ;;
  1337. esac
  1338. /bin/dd if=/tmp-fs of=/dev/nd2 bs=512 count=128 >/dev/null 2>&1
  1339. /etc/mount /dev/nd2 /tmp
  1340. /etc/ifconfig le0 netmask 255.255.255.0 broadcast 132.206.41.255
  1341. /etc/mount -o ro apollo:/u2/x11/lib /local/lib/X11
  1342. /etc/route add default 132.206.41.1 1 >/dev/null
  1343. set `/etc/ifconfig le0`
  1344. exec /Xsun -once -multidisp -mux -query `(sh -vn </local/lib/X11/xdm-servers/$2 2>&1)`
  1345.  
  1346. ----------------------------------------------------------------------
  1347. Subject:  71)  Where can I obtain an X-based plotting program?
  1348.  
  1349. These are mostly available from uucp sites such as uunet or other sites as
  1350. marked.
  1351.  
  1352.  gnuplot    X (xplot), PostScript and a bunch of other drivers.
  1353.     cs.duke.edu:/dist/sources/gnuplot/gnuplot2.02.tar.Z [128.109.140.1]
  1354.     monu1.cc.monash.edu.au:/pub/gnuplot2.02.tar.Z [130.194.1.101]
  1355.     irisa.irisa.fr:/pub/gnuplot2.02.tar.Z [131.254.2.3]
  1356.     comp.sources.misc/volume8
  1357.  
  1358.  gl_plot    X output only [?]
  1359.     comp.sources.unix/volume18
  1360.  
  1361.  graph+
  1362.     yallara.cs.rmit.oz.au:/pub/graph+.tar.Z [131.170.24.42]
  1363.     comp.sources.unix/volume8
  1364.  
  1365.  pdraw,drawplot        2D and 3D X,PS
  1366.     scam.berkeley.edu:/src/local/3dplot.tar.Z [128.32.138.1]
  1367.     scam.berkeley.edu:/src/local/contour.tar.Z [128.32.138.1]
  1368.     scam.berkeley.edu:/src/local/drawplot.tar.Z [128.32.138.1]
  1369.     uunet:~ftp/contrib/drawplot.tar.Z
  1370.  
  1371.  xgraph        plot, zoom. Outputs PS or HPGL.
  1372.     shambhala.berkeley.edu:/pub/xgraph-11.tar.Z [128.32.132.54]
  1373.     sun1.ruf.uni-freiburg.de:X11/contrib/xgraph-11.tar.Z [132.230.1.1]
  1374.     nisc.jvnc.net:pub/xgraph-11.tar.Z [128.121.50.7]
  1375.     comp.sources.x/volume3
  1376.     or many other sites 
  1377.  
  1378.  xvgr        An XView xgraph++ program.
  1379.     sun.soe.clarkson.edu:pub/src/xvgr-1.06alpha.tar.Z [128.153.12.3]
  1380.     uvax.rrz.uni-koeln.de:pub/windows/xcontrib/xvgr-1.06alpha.tar.Z 
  1381.  
  1382. [2/91. Thanks to:
  1383. emv@ox.com (Ed Vielmetti) ; geoff@Veritas.COM (Geoffrey Leach) ;
  1384. Paul A. Scowen (uk1@spacsun.rice.edu) ;  black@beno.CSS.GOV (Mike Black)]
  1385.  
  1386. ----------------------------------------------------------------------
  1387. Subject:  76)  Where can I get an X-based TeX or DVI previewer?
  1388.  
  1389.     The xtex previewer for TeX files is available from a number of archive 
  1390. sites, including uunet; the current version is usually on foobar.colorado.edu 
  1391. (128.138.243.105) in SeeTeX-2.17.0.tar.Z; pre-converted fonts are also on that 
  1392. machine. The distribution all includes "mftobdf" which converts PK, GF, and PXL
  1393. fonts to BDF format, where they can then be compiled for use by your local X
  1394. server. Xtex 2.17 was announced 3/1/91. 
  1395.     The xdvi dvi-previewer is fairly comprehensive and easy to use. It is 
  1396. also available from a number of sites, including uunet and export.lcs.mit.edu.
  1397.  
  1398. ----------------------------------------------------------------------
  1399. Subject:  79)  Where can I find X tools callable from shell scripts?
  1400. I want to have a shell script pop up menus and yes/no dialog boxes if the user 
  1401. is running X.
  1402.  
  1403.     Several tools in the R3 contrib/ area were developed to satisfy these
  1404. needs: yorn pops up a yes/no box, xmessage displays a string, etc. There are
  1405. several versions of these tools; few, if any, have made it to the R4 contrib/ 
  1406. area, though they may still be available on various archive sites.
  1407.     In addition, Richard Hesketh (rlh2@ukc.ac.uk) has posted the xmenu
  1408. package to comp.sources.x ("v08i008: xmenu") for 1-of-n choices.  [7/90]
  1409.     Two versions of XPrompt have been posted to comp.sources.x, the latter
  1410. being an unauthorized rewrite. [R. Forsman (thoth@reef.cis.ufl.edu), 1/91]
  1411.     There is a version of XMenu available from comp.sources.x; it is
  1412. being worked on and will likely be re-released.
  1413.  
  1414. ----------------------------------------------------------------------
  1415. Subject:  82)  TOPIC: BUILDING THE X DISTRIBUTION 
  1416. ----------------------------------------------------------------------
  1417. Subject:  83)  How do I build X with gcc?
  1418.  
  1419.     MIT is now using regularly the Free Software Foundation's
  1420. GNU-CC to build the X distribution and uses gcc-built servers to test 
  1421. performance increases. 
  1422.  
  1423.     [These options are gathered from several descriptions of building
  1424. X with gcc 1.34, 1.35, and 1.36, and are possibly outdated]:
  1425.  
  1426.     Use the options
  1427.         -O -fstrength-reduce -fpcc-struct-return
  1428.  
  1429.         -traditional may also be necessary if your version of
  1430. gcc is sufficiently old (but don't use with 1.38).
  1431.  
  1432.     Do not use -finline-functions, particularly on the R4 server.
  1433.  
  1434.     --->    Make sure to run 'fixincludes' from the gcc distribution 
  1435.     --->    before doing anything, or you will get fatal errors such as:
  1436.     --->    xterm: Error 15, errno 25: Inappropriate ioctl for device.
  1437.  
  1438. HOWEVER, there is a bug in gcc 1.34 and 1.36 (but not in 1.35 or 1.37) which 
  1439. miscompiles things of the form (expr == 0 ? exp1 : exp2).  The fix needed in 
  1440. X11R4 (and probably X11R3) is to change the definition of XtNewString in 
  1441. Intrinsic.h to:
  1442.   #define XtNewString(str) \
  1443.   ((str) != NULL ? (strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) : NULL)
  1444. A work-around is also in fix-2 to X11R4.
  1445.  
  1446. ----------------------------------------------------------------------
  1447. Subject:  85)  What are these I/O errors running X built with gcc?
  1448. When I try to run xinit or the Xsun server I get the error 
  1449.     "Getting interface configuration: Operation not supported on socket. 
  1450.     Fatal server bug! no screens found."
  1451.  
  1452.     Running the gcc fixincludes script apparently didn't work. You can do 
  1453. this simple test:
  1454.  
  1455.     #include <sys/ioctl.h>
  1456.     SIOCGIFCONF
  1457.  
  1458. Run that through cc -E and gcc -E.  The last line of output is the piece of 
  1459. interest; it should be identical (modulo irrelevant differences like 
  1460. whitespace).  If the gcc version has 'x' where the cc version has 'i', your 
  1461. fixincludes run didn't work for some reason or other; go back to your gcc
  1462. sources and run `fixincludes`; then rebuild the X distribution. If they are 
  1463. identical, try running a make clean in mit/server and rebuilding, just to make 
  1464. sure everything gets compiled with the proper include files.  
  1465.  
  1466. [courtesy der Mouse, mouse@LARRY.MCRCIM.MCGILL.EDU; 9/90]
  1467.  
  1468. ----------------------------------------------------------------------
  1469. Subject:  86)  What are these problems compiling X11R4 with "gcc -traditional"?
  1470.  
  1471.     There are known problems with gcc 1.38 which cause use of the 
  1472. -traditional to produce errors along the lines of "gcc: Program cpp got fatal 
  1473. signal 6". The fix is to upgrade to 1.39. 
  1474.  
  1475. [from Darryl Okahata (darrylo%hpnmd@relay.hp.com); 2/91]
  1476.  
  1477. ----------------------------------------------------------------------
  1478. Subject:  87)  What are these problems compiling X11R4 on the older Sun3?
  1479. In mit/server/ddx/sun/sunCG3C.c, we have found "missing" defines for 
  1480. CG3AC_MONOLEN, CG3BC_MONOLEN, CG3AC_ENBLEN, CG3BC_ENBLEN. What should these be?
  1481.  
  1482.     The R4 Errata list distributed after X11R4 mentions that you can add
  1483. these lines to the file on older SunOS versions (e.g. 3.5) to compile:
  1484.         #define CG3AC_MONOLEN (128*1024)
  1485.         #define CG3AC_ENBLEN  CG3AC_MONOLEN
  1486.         #define CG3BC_MONOLEN CG3AC_MONOLEN
  1487.         #define CG3BC_ENBLEN  CG3AC_MONOLEN
  1488.  
  1489.     However, the Sun3 should not actually ever have the CG3 device, and so 
  1490. references to it can be removed from mit/server/ddx/sun/sunInit.c and the 
  1491. Imakefile.  [11/90]
  1492.  
  1493. ----------------------------------------------------------------------
  1494. Subject:  88)  What are these problems compiling the X11R4 server on SunOS 4.1.1?
  1495. The file <sundev/cg6reg.h> isn't being found.
  1496.  
  1497.     Sun omitted <sundev/cg6reg.h> from SunOS 4.1.1. Remove the #include 
  1498. from sunCG6C.c and replace it with the line 
  1499.     #define CG6_VADDR_COLOR   0x70016000
  1500. The file has changed from earlier versions of SunOS and should not be copied 
  1501. from another distribution.
  1502.  
  1503. ----------------------------------------------------------------------
  1504. Subject:  89)  What are these problems using R4 shared libraries on SunOS 4?
  1505. All of the executables that I try to run have the following results:
  1506.     ld.so: libXmu.so.4: not found
  1507. or even:
  1508.     ld.so: call to undefined procedure __GetHostname from 0xf776a96c
  1509.  
  1510.     If you are building with shared libraries on a Sun, remember that you 
  1511. need to run "ldconfig" as root after installing the shared libraries (if you've
  1512. installed X on a file-server, run it on the server's clients, too).  While 
  1513. building and installing the distribution, you need to be careful to avoid 
  1514. linking against any existing X shared libraries you might have (e.g. those 
  1515. distributed with OpenWindows).  You should make sure you do not have 
  1516. LD_LIBRARY_PATH set in your environment during the build or the installation.  
  1517. If you are going to keep xterm and xload as setuid programs, please note that 
  1518. the shared libraries must be installed in /usr/lib, /usr/local/lib, or 
  1519. /usr/5lib for these programs to work (or else those programs must be linked 
  1520. statically). [courtesy MIT X Consortium]
  1521.     Note also that the program mkfontdir is run as part of the build; it
  1522. attempts, however, to use the shared libraries before they have been installed.
  1523. You can avoid the errors by building mkfontdir statically (pass -Bstatic to
  1524. most C compilers).
  1525.  
  1526. ----------------------------------------------------------------------
  1527. Subject:  92)  TOPIC: BUILDING X PROGRAMS
  1528. ----------------------------------------------------------------------
  1529. Subject:  93)  What is Imake?
  1530.  
  1531.     Imake is not a replacement for the make program; instead, it is a
  1532. makefile-generator that takes advantages of the include-file and macro-
  1533. processing capabilities of the C preprocessor cpp to generate makefiles 
  1534. suitable for building software on a particular system. Although it is not 
  1535. specific to X, the X release uses it to help solve a number of the 
  1536. configuration issues that arise in making such a large system widely portable.
  1537.     Imake has a fairly steep learning curve, in part because the process by
  1538. which the system-specific configuration files, system-independent configuration
  1539. files, and individual Imakefiles are melded to produce a Makefile is not 
  1540. obvious.
  1541.     You can obtain information on imake from these sources:
  1542.     - Paul Dubois (dubois@primate.wisc.edu) has written a useful 
  1543. explanation of how Imake works and how to use it in configuring X for non-
  1544. supported systems; the document is available from indri.primate.wisc.edu 
  1545. (128.104.230.11) in the directory ~ftp/pub/imake-stuff; look for 
  1546. config-X11R4.ms (troff) and config-X11R4.ps (PostScript). Some supplemental
  1547. appendices are nearby.
  1548.     - the R4 release notes and imake man page include information on using 
  1549. Imake to build X
  1550.     - on the R4 tapes, contrib/doc/imake/imake.tex is Mark Moraes' R3/R4
  1551. guide to imake.
  1552.     - and check the R4 mit/config directory for the source files
  1553.  
  1554. [1/91]
  1555.  
  1556. ----------------------------------------------------------------------
  1557. Subject:  94)  Where can I get imake?
  1558.  
  1559.     A version is distributed with the X11R4 release. An earlier version is 
  1560. distributed with the X11R3 release; some third-party toolkits redistribute 
  1561. versions of imake along with their own implementations of the template and 
  1562. configuration files. There are no real standards for such configuration files, 
  1563. although most current contributed software expects the templates distributed 
  1564. with X11R4.
  1565.     There are no known archive sites which have imake in a form in which
  1566. it can be downloaded without downloading most of the X11 release. [2/91]
  1567.  
  1568. ----------------------------------------------------------------------
  1569. Subject:  95)  I have a program with an Imakefile but no Makefile. What to do?
  1570.  
  1571.     If you have R4 installed on your system, run "xmkmf". This is a script
  1572. which runs imake for you with the correct arguments. The output is a Makefile
  1573. configured for your system and based on the Imakefile. Then run make, which 
  1574. will use that new Makefile to compile the program.
  1575.  
  1576. ----------------------------------------------------------------------
  1577. Subject:  96)  Why can't I link to the Xlib shape routines?
  1578. When I try to compile certain programs, I get the following link error:
  1579.     Undefined:
  1580.     _XShapeQueryExtension
  1581.     _XShapeCombineMask
  1582.  
  1583.     These routines are actually part of the Shape Extension to X (SHAPE)
  1584. which was introduced in the MIT X11R4 distribution and allows non-rectangular
  1585. windows.  Like the other sample server extensions, the shape extension will 
  1586. only run on a server which supports it.  Pre-X11R4 servers, as well as many 
  1587. vendor-supplied servers, do not support the shape extension, in which case 
  1588. they will display rectangular windows anyway.
  1589.  
  1590.     In order to use the shape extension, you must link to the library 
  1591. libXext.a.  In the X11R4 distribution, this library and the associated includes
  1592. will be in the mit/extensions directory.  If you do not have these files, do 
  1593. not despair:  many freeware programs which use the shape extension can also be 
  1594. compiled without it by removing the -DSHAPE define from the Makefile; you can
  1595. probably do this and compile successfully against your older vendor-supplied X 
  1596. libraries.
  1597.  
  1598. [from John B. Melby, melby%yk.fujitsu.co.jp@uunet.uu.net, 3/91]
  1599.  
  1600. ----------------------------------------------------------------------
  1601. Subject:  97)  What are these problems with "_XtInherit not found" on the Sun?
  1602. When I run a X program that I wrote on a SunOS 4.0.3 or 4.1 machine I get the 
  1603. error "ld.so: symbol not found _XtInherit".
  1604.  
  1605.     What you are seeing is a side-effect of a kludge in the R4 libXt.a to 
  1606. get Sun shared libraries working.  Apparently, you can't share a function that 
  1607. is both called and compared, as _XtInherit is. This was handled by putting 
  1608. _XtInherit in the same file as a function that is always used, thereby 
  1609. guaranteeing that it would be loaded -- that is, in Initialize.c, where 
  1610. XtToolkitInitialize() and XtInitialize() reside. These routines would normally
  1611. be called.
  1612.  
  1613.     You are probably seeing this error because your program is not a normal
  1614. Xt-based program and does not call XtToolkitInitialize() anywhere. 
  1615.     1) it may be a program that uses Xt functions but never opens a 
  1616. connection to the X server.  [OSF/Motif's 1.1.0 UIL had this problem; it called
  1617. XtMalloc() and other Xt functions.] The solution is to add the call to your 
  1618. program; the function does not have to be executed, just linked in.
  1619.     2) alternatively, your program doesn't need any Xt functions and is
  1620. correct in not calling XtToolkitInitialize() -- it may be an Xlib or XView 
  1621. program. In this case, you can remove -lXt from your link command. 
  1622.  
  1623.     It should not be necessary to link the shared libraries statically,
  1624. although this will certainly solve the problem.
  1625.     
  1626. [from Jordan Hayes (now jordan@tcs.COM) and Danny Backx (db@sunbim.be); 11/90]
  1627.  
  1628. ----------------------------------------------------------------------
  1629. Subject:  98)  Why can't I compile my R3 Xaw contrib programs under R4?
  1630. I have a program that worked well under X11R3. When I try to link it under 
  1631. X11R4, I get this message:
  1632.     Undefined:
  1633.     _XtScrollBarSetThumb
  1634.     _XtTextSetInsertionPoint
  1635.     _XtTextReplace
  1636.  
  1637.     There were several name changes in the Athena widget set (in addition
  1638. to the header files moving into <X11/Xaw/>); these are mentioned in the R4
  1639. release notes. In this case, these functions are not really Xt functions but
  1640. are part of the Xaw text widget and so have been renamed from Xt* to Xaw*.
  1641. [10/90]
  1642.  
  1643. ----------------------------------------------------------------------
  1644. Subject:  99)  TOPIC: PROGRAMMING PROBLEMS AND PUZZLES
  1645. ----------------------------------------------------------------------
  1646. Subject: 100)  Why doesn't my program get the keystrokes I select for?
  1647.  
  1648.     The window manager controls how the input focus is transferred from one
  1649. window to another.  In order to get keystrokes, your program must ask the
  1650. window manager for the input focus.  To do this, you must set up what are
  1651. called "hints" for the window manager.  If your applications is Xlib-based, you
  1652. can use something like the following:
  1653.  
  1654.         XWMHints wmhints;
  1655.         ...
  1656.         wmhints.flags = InputHint;
  1657.         wmhints.input = True;
  1658.         XSetWMHints(dpy, window, &hints)
  1659.  
  1660.  
  1661. If your application is based on the Xt Intrinsics, you can set the XtNinput 
  1662. resource to be True (as you probably want to in any case); if you don't have
  1663. source, you can start up the application with the resource '*input:True'.
  1664.  
  1665. Certain window managers, notably dxwm and olwm, are very picky about having 
  1666. this done. 
  1667.  
  1668.     If you are using Sun's OpenWindows olwm, you can also add this resource
  1669. to your defaults file to use clients that aren't ICCCM-compliant.
  1670.     OpenWindows.FocusLenience:       true
  1671.  
  1672. [mostly courtesy Dave Lemke of NCD and Stuart Marks of Sun]
  1673.  
  1674. ----------------------------------------------------------------------
  1675. Subject: 101)  How do I figure out what window manager is running?
  1676.  
  1677.     You can't reliably tell; whatever mechanism you could use could be
  1678. spoofed in any case. 
  1679.     For most cases, you shouldn't care which window manager is running, so 
  1680. long as you do things in an ICCCM-conformant manner. There are some cases in 
  1681. which particular window managers are known to do things wrong; checking for
  1682. particular hints placed on the window by the window manager so that you can 
  1683. sidestep the problem may be appropriate in these cases. Alternatively, it may 
  1684. be appropriate to determine which window manager is running in order to take
  1685. advantage of specific added features (such as olwm's push-pin menus).
  1686.  
  1687. ----------------------------------------------------------------------
  1688. Subject: 102)  Is there a skeleton X program available?
  1689.     
  1690.     There is no general framework such as the TransSkel program for the 
  1691. Macintosh which handles lots of the odds and ends and overhead of development 
  1692. under a window system and which can be used as a platform for additional 
  1693. development. In X, the problem is typically solved by using an interactive 
  1694. application builder tool or by using cut&paste on existing X applications. Good
  1695. applications which you might look to manipulate when you want to "test just 
  1696. this one little thing" include contrib/clients/xskel, a simple R4 program that 
  1697. puts up a window and allows sketching in it and offers a starting point for
  1698. quick hacks, the Xaw examples in the examples/ directory in the R3 and R4 
  1699. distributions, and the Xlib "Hello World" example in the R3 doc/HelloWorld and 
  1700. R4 doc/tutorials/HelloWorld; an updated version of this program which uses R4 
  1701. Xlib calls and current ICCCM conventions was posted in 2/90 to comp.windows.x  
  1702. by Glenn Widener of Tektronix.     [3/90]
  1703.  
  1704. ----------------------------------------------------------------------
  1705. Subject: 103)  Why does XtGetValues not work for me?
  1706.  
  1707.     The XtGetValues interface for retrieving resources from a widget is
  1708. sensitive to the type of variable. Your code may be doing something like this:
  1709.     {
  1710.     Arg args[3];
  1711.     int i;
  1712.     int sensitive;        /* oops; wrong data type */
  1713.     i=0;
  1714.     XtSetArg (args[i], XtNsensitive, &sensitive); i++;
  1715.     XtGetValues(widget, args, i );
  1716.     ...
  1717.     }
  1718.  
  1719. But XtNsensitive is a Boolean, which on most machines is a single byte; 
  1720. declaring the variable "sensitive" as Boolean works properly. This problem 
  1721. comes up often when using particular toolkits that redefine the Xt types 
  1722. Dimension and Position; code that assumes they are int will have similar 
  1723. problems if those types are actually short. In general: you are safe if you
  1724. use the actual type of the resource, as it appears in the widget's man page.
  1725. [11/90]
  1726.  
  1727. ----------------------------------------------------------------------
  1728. Subject: 104)  Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
  1729.  
  1730.     You're probably trying to use these functions from application code.
  1731. They should be used only internally to widgets; these functions are for a 
  1732. parent widget to change the geometry of its children. Other promising functions,
  1733. XtMakeGeometryRequest() and XtMakeResizeRequest(), are also for use only by 
  1734. widgets, in this case by a child to request a change from its parent.
  1735.     The only way for your application to request a geometry change for a
  1736. widget is to issue an XtSetValues call setting some of the geometry resources.
  1737. Although this will result in the widget-internal functions' being called, your
  1738. application code must use the standard XtSetValues interface or risk the 
  1739. widgets' data becoming corrupted.
  1740.  
  1741. ----------------------------------------------------------------------
  1742. Subject: 105)  How can my application tell if it is being run under X?
  1743.  
  1744.     A number of programs offer X modes but otherwise run in a straight
  1745. character-only mode. The easiest way for an application to determine that it is
  1746. running on an X display is to attempt to open a connection to the X server:
  1747.     
  1748.     display = XOpenDisplay(display_name);
  1749.     if (display)
  1750.         { do X stuff }
  1751.     else
  1752.         { do curses or something else }
  1753. where display_name is either the string specified on the command-line following
  1754. -display, by convention, or otherwise is (char*)NULL [in which case XOpenDisplay
  1755. uses the value of $DISPLAY, if set].
  1756.  
  1757. This is superior to simply checking for the existence a -display command-line 
  1758. argument or checking for $DISPLAY set in the environment, neither of which is 
  1759. adequate. [5/91]
  1760.  
  1761. ----------------------------------------------------------------------
  1762. Subject: 106)  How do I make a "busy cursor" while my application is computing?
  1763. Is it necessary to call XDefineCursor() for every window in my application?
  1764.  
  1765.     The easiest thing to do is to create a single InputOnly window that is 
  1766. as large as the largest possible screen; make it a child of your toplevel 
  1767. window and it will be clipped to that window, so it won't affect any other 
  1768. application. (It needs to be as big as the largest possible screen in case the 
  1769. user enlarges the window while it is busy or moves elsewhere within a virtual 
  1770. desktop.) Substitute "toplevel" with your top-most widget here (similar code 
  1771. should work for Xlib-only applications; just use your top Window):
  1772.  
  1773.      unsigned long valuemask;
  1774.      XSetWindowAttributes attributes;
  1775.  
  1776.      /* Ignore device events while the busy cursor is displayed. */
  1777.      valuemask = CWDontPropagate | CWCursor;
  1778.      attributes.do_not_propagate_mask =  (KeyPressMask | KeyReleaseMask |
  1779.          ButtonPressMask | ButtonReleaseMask | PointerMotionMask);
  1780.      attributes.cursor = XCreateFontCursor(XtDisplay(toplevel), XC_watch);
  1781.  
  1782.      /* The window will be as big as the display screen, and clipped by
  1783.         its own parent window, so we never have to worry about resizing */
  1784.      XCreateWindow(XtDisplay(toplevel), XtWindow(toplevel), 0, 0,
  1785.          65535, 65535, (unsigned int) 0, CopyFromParent, InputOnly,
  1786.          CopyFromParent, valuemask, &attributes);
  1787.  
  1788. When you want to use this busy cursor, map and raise this window; to go back to
  1789. normal, unmap it. This will automatically keep you from getting extra mouse
  1790. events; depending on precisely how the window manager works, it may or may not
  1791. have a similar effect on keystrokes as well.
  1792.  
  1793. In addition, note also that most of the Xaw widgets support an XtNcursor 
  1794. resource which can be temporarily reset, should you merely wish to change the
  1795. cursor without blocking pointer events.
  1796.  
  1797. [thanks to Andrew Wason (aw@cellar.bae.bellcore.com), Dan Heller (argv@sun.com),
  1798. and mouse@larry.mcrcim.mcgill.edu; 11/90,5/91]
  1799.  
  1800. ----------------------------------------------------------------------
  1801. Subject: 107)  How do I query the user synchronously using Xt?
  1802.     
  1803.     It is possible to have code which looks like this trivial callback,
  1804. which has a clear flow of control. The calls to AskUser() block until answer
  1805. is set to one of the valid values. If it is not a "yes" answer, the code drops
  1806. out of the callback and back to an event-processing loop: 
  1807.  
  1808.     void quit(w, client, call)
  1809.         Widget          w;
  1810.         XtPointer client, call;
  1811.     {
  1812.         int             answer;
  1813.         answer = AskUser(w, "Really Quit?");
  1814.         if (RET_YES == answer)
  1815.             {
  1816.             answer = AskUser(w, "Are You Really Positive?");
  1817.             if (RET_YES == answer)
  1818.                 exit(0);
  1819.                 }
  1820.     }
  1821.  
  1822.     A more realistic example might ask whether to create a file or whether 
  1823. to overwrite it.
  1824.     This is accomplished by entering a second event-processing loop and
  1825. waiting until the user answers the question; the answer is returned to the
  1826. calling function. That function AskUser() looks something like this, where the 
  1827. Motif can be replaced with widget-set-specific code to create some sort of 
  1828. dialog-box displaying the question string and buttons for "OK", "Cancel" and 
  1829. "Help" or equivalents:
  1830.  
  1831.   int AskUser(w, string)
  1832.         Widget          w;
  1833.         char           *string;
  1834.   {
  1835.         int             answer=RET_NONE;    /* some not-used marker */
  1836.         Widget          dialog;            /* could cache&carry, but ...*/
  1837.         Arg             args[3];
  1838.         int             n = 0;
  1839.         XtAppContext    context;
  1840.  
  1841.         n=0;
  1842.         XtSetArg(args[n], XmNmessageString, XmStringCreateLtoR(string,
  1843.                 XmSTRING_DEFAULT_CHARSET)); n++;
  1844.         XtSetArg(args[n], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); n++;
  1845.         dialog = XmCreateQuestionDialog(XtParent(w), string, args, n);
  1846.         XtAddCallback(dialog, XmNokCallback, response, &answer);
  1847.         XtAddCallback(dialog, XmNcancelCallback, response, &answer);
  1848.         XtAddCallback(dialog, XmNhelpCallback, response, &answer);
  1849.         XtManageChild(dialog);
  1850.  
  1851.         context = XtWidgetToApplicationContext (w);
  1852.         while (answer == RET_NONE || XtAppPending(context)) {
  1853.                 XtAppProcessEvent (context, XtIMAll);
  1854.         }
  1855.         XtDestroyWidget(dialog);    /* blow away the dialog box and shell */
  1856.         return answer;
  1857.   }
  1858.  
  1859.     The dialog supports three buttons, which are set to call the same 
  1860. function when tickled by the user.  The variable answer is set when the user 
  1861. finally selects one of those choices:
  1862.  
  1863.   void response(w, client, call)
  1864.         Widget          w;
  1865.         XtPointer client;
  1866.         XtPointer call;
  1867.   {
  1868.   int *answer = (int *) client;
  1869.   XmAnyCallbackStruct *reason = (XmAnyCallbackStruct *) call;
  1870.         switch (reason->reason) {
  1871.         case XmCR_OK:
  1872.                 *answer = RET_YES;    /* some #define value */
  1873.                 break;
  1874.         case XmCR_CANCEL:
  1875.                 *answer = RET_NO;
  1876.                 break;
  1877.         case XmCR_HELP:
  1878.                 *answer = RET_HELP;
  1879.                 break;
  1880.         default:
  1881.                 return;
  1882.         }
  1883. }
  1884.  
  1885. and the code unwraps back to the point at which an answer was needed and
  1886. continues from there.
  1887.  
  1888. [Thanks to Dan Heller (argv@sun.com); further code is in Dan's R3/contrib
  1889. WidgetWrap library. 2/91]
  1890.  
  1891. ----------------------------------------------------------------------
  1892. Subject: 108)  How do I fork without hanging my parent X program?
  1893.  
  1894.     An X-based application which spawns off other Unix processes which 
  1895. continue to run after it is closed typically does not vanish until all of its 
  1896. children are terminated; the children inherit from the parent the open X 
  1897. connection to the display. 
  1898.     What you need to do is fork; then, immediately, in the child process, 
  1899.     close (ConnectionNumber(XtDisplay(widget)));
  1900. to close the file-descriptor in the display information. After this do your 
  1901. exec. You will then be able to exit the parent.
  1902.  
  1903. [Thanks to Janet Anstett (anstettj@tramp.Colorado.EDU) and Gordon Freedman 
  1904. (gjf00@duts.ccc.amdahl.com) 2/91]
  1905.  
  1906. ----------------------------------------------------------------------
  1907. Subject: 109)  Why does XtAppAddInput not work as described?
  1908. I am using XtAppAddInput to read from a file, but the function is called even
  1909. when there isn't input pending.
  1910.  
  1911.     XtAppAddInput is actually working as it is supposed to. When used on
  1912. files, it is called whenever the file is READY to be read, not when there is
  1913. new data to be read. The file is almost always ready to be read, however, if 
  1914. only because you can spin back to the beginning and read data you've read 
  1915. before. The result is that your function will almost always be called every
  1916. time around XtMainLoop(). There is a way to get the type of interaction you are
  1917. expecting; add this line to the beginning of your function to test whether 
  1918. there is new data:
  1919.          if (ioctl(fd, FIONREAD, &n) == -1 || n == 0) return;
  1920. But, because this is called frequently, your application is effectively in a 
  1921. busy-wait; you may be better off not using XtAppAddInput and instead setting a 
  1922. timer and in the timer procedure checking the file for input.
  1923.  
  1924. [courtesy Dan Heller (argv@ora.com), 8/90; mouse@larry.mcrcim.mcgill.edu 5/91]
  1925.  
  1926. ----------------------------------------------------------------------
  1927. Subject: 110)  How do I simulate a button press/release event for a widget?
  1928.  
  1929.     You can do this using XSendEvent(); it's likely that you're not setting
  1930. the window field in the event, which Xt needs in order to match to the widget
  1931. which should receive the event.
  1932.      If you're sending events to your own application, then you can use 
  1933. XtDispatchEvent() instead. This is more efficient than XSendEvent() in that you
  1934. avoid a round-trip to the server.
  1935.  
  1936. [courtesy Mark A. Horstman (mh2620@sarek.sbc.com), 11/90]
  1937.  
  1938. ----------------------------------------------------------------------
  1939. Subject: 111)  Why doesn't anything appear when I run this simple program?
  1940.  
  1941. > ...
  1942. > the_window = XCreateSimpleWindow(the_display,
  1943. >      root_window,size_hints.x,size_hints.y,
  1944. >      size_hints.width,size_hints.height,BORDER_WIDTH,
  1945. >      BlackPixel(the_display,the_screen),
  1946. >      WhitePixel(the_display,the_screen));
  1947. > ...
  1948. > XSelectInput(the_display,the_window,ExposureMask|ButtonPressMask|
  1949. >     ButtonReleaseMask);
  1950. > XMapWindow(the_display,the_window);
  1951. > ...
  1952. > XDrawLine(the_display,the_window,the_GC,5,5,100,100);
  1953. > ...
  1954.  
  1955.     You are right to map the window before drawing into it. However, the 
  1956. window is not ready to be drawn into until it actually appears on the screen --
  1957. until your application receives an Expose event. Drawing done before that will 
  1958. generally not appear. You'll see code like this in many programs; this code 
  1959. would appear after window was created and mapped:
  1960.   while (!done)
  1961.     {
  1962.       XNextEvent(the_display,&the_event);
  1963.       switch (the_event.type) {
  1964.     case Expose:     /* On expose events, redraw */
  1965.         XDrawLine(the_display,the_window,the_GC,5,5,100,100);
  1966.         break;
  1967.     ...
  1968.     }
  1969.     }
  1970.  
  1971.     Note that there is a second problem: some X servers don't set up the 
  1972. default graphics context to have reasonable foreground/background colors, and 
  1973. your program should not assume that the server does, so this program could 
  1974. previously include this code to prevent the case of having the foreground and 
  1975. background colors the same:
  1976.   ...
  1977.   the_GC_values.foreground=BlackPixel(the_display,the_screen);    /* e.g. */
  1978.   the_GC_values.background=WhitePixel(the_display,the_screen);    /* e.g. */
  1979.   the_GC = XCreateGC(the_display,the_window,
  1980.                 GCForeground|GCBackground,&the_GC_values);
  1981.   ...
  1982.  
  1983. Note: the code uses BlackPixel and WhitePixel to avoid assuming that 1 is 
  1984. black and 0 is white or vice-versa.  The relationship between pixels 0 and 1 
  1985. and the colors black and white is implementation-dependent.  They may be 
  1986. reversed, or they may not even correspond to black and white at all.
  1987.  
  1988. ----------------------------------------------------------------------
  1989. Subject: 112)  What is the difference between a Screen and a screen?
  1990.  
  1991.     The 'Screen' is an Xlib structure which includes the information about
  1992. one of the monitors or virtual monitors which a single X display supports. A 
  1993. server can support several independent screens. They are numbered unix:0.0,
  1994. unix:0.1, unix:0.2, etc; the 'screen' or 'screen_number' is the second digit --
  1995. the 0, 1, 2 which can be thought of as an index into the array of available 
  1996. Screens on this particular Display connection.
  1997.     The macros which you can use to obtain information about the particular
  1998. Screen on which your application is running typically have two forms -- one
  1999. which takes a Screen and one with takes both the Display and the screen_number.
  2000.     In Xt-based programs, you typically use XtScreen(widget) to determine 
  2001. the Screen on which your application is running, if it uses a single screen.
  2002.     (Part of the confusion may arise from the fact that some of the macros
  2003. which return characteristics of the Screen have "Display" in the names -- 
  2004. XDisplayWidth, XDisplayHeight, etc.)
  2005.     
  2006. ----------------------------------------------------------------------
  2007. Subject: 114)  How do I determine the name of an existing widget?
  2008. I have a widget ID and need to know what the name of that widget is.
  2009.  
  2010.     R4 users are best off using the XtName() function, which will work
  2011. on both widgets and non-widget objects.
  2012.  
  2013.     If you are still using R3, you can use this simple bit of code to do 
  2014. what you want. Note that it depends on the widget's internal data structures 
  2015. and is not portable to future versions of Xt, including R4.
  2016.  
  2017.     #include <X11/CoreP.h>
  2018.     String XtName (widget)
  2019.     Widget widget;    /* will not work with non-widget objects */
  2020.     {
  2021.     return widget->core.name;
  2022.     }
  2023.  
  2024. [7/90]
  2025.  
  2026. ----------------------------------------------------------------------
  2027. Subject: 115)  What widget is appropriate to use as a drawing canvas?
  2028.  
  2029.     Some widget sets have a widget particularly for this purpose -- a
  2030. WorkSpace or DrawingArea which doesn't display anything but lets your Xt 
  2031. application know when it has been re-exposed, resized, and when it has received
  2032. user key and mouse input. 
  2033.     The best thing to do for other widget sets -- including the Athena set 
  2034. -- is to create or obtain such a widget; this is preferable to drawing into a 
  2035. core widget and grabbing events with XtAddEventHandler(), which loses a number 
  2036. of benefits of Xt and encapsulation of the functionality .  At least one 
  2037. version has been posted to comp.sources.x (name???). The publicly-available 
  2038. programs xball and xpic include other versions. And Chapter 7 of the Athena 
  2039. Widget manual includes a tutorial and source code to a simple Window widget 
  2040. which is suitable for use.
  2041.  
  2042. ----------------------------------------------------------------------
  2043. Subject: 116)  Why do I get a BadDrawable error drawing to XtWindow(widget)?
  2044. I'm doing this in order to get a window into which I can do Xlib graphics
  2045. within my Xt-based program:
  2046.  
  2047. > canvas = XtCreateManagedWidget ( ...,widgetClass,...) /* drawing area */
  2048. > ...
  2049. > window = XtWindow(canvas);    /* get the window associated with the widget */
  2050. > ...
  2051. > XDrawLine (...,window,...);    /* produces error */
  2052.  
  2053.     The window associated with the widget is created as a part of the 
  2054. realization of the widget.  Using a window id of NULL ("no window") could 
  2055. create the error that you describe.  It is necessary to call XtRealizeWidget() 
  2056. before attempting to use the window associated with a widget. 
  2057.     Note that the window will be created after the XtRealizeWidget() call, 
  2058. but that the server may not have actually mapped it yet, so you should also 
  2059. wait for an Expose event on the window before drawing into it.
  2060.  
  2061. ----------------------------------------------------------------------
  2062. Subject: 117)  Can XGetWindowAttributes get a window's background pixel/pixmap?
  2063.  
  2064.     No.  Once set, the background pixel or pixmap of a window cannot be 
  2065. re-read by clients.  The reason for this is that a client can create a pixmap,
  2066. set it to be the background pixmap of a window, and then free the pixmap. The 
  2067. window keeps this background, but the pixmap itself is destroyed.  If you're 
  2068. sure a window has a background pixel (not a pixmap), you can use XClearArea() 
  2069. to clear a region to the background color and then use XGetImage() to read 
  2070. back that pixel.  However, this action alters the contents of the window, and 
  2071. it suffers from race conditions with exposures. [courtesy Dave Lemke of NCD 
  2072. and Stuart Marks of Sun]
  2073.  
  2074.     Note that the same applies to the border pixel/pixmap. This is a 
  2075. (mis)feature of the protocol which allows the server is free to manipulate the
  2076. pixel/pixmap however it wants.  By not requiring the server to keep the 
  2077. original pixel or pixmap, some (potentially a lot of) space can be saved. 
  2078. [courtesy Jim Fulton, MIT X Consortium]
  2079.  
  2080. ----------------------------------------------------------------------
  2081. Subject: 118)  Why doesn't GXxor produce mathematically-correct color values?
  2082.  
  2083.     When using GXxor you may expect that drawing with a value of black on a
  2084. background of black, for example, should produce white. However, the drawing
  2085. operation does not work on RGB values but on colormap indices. The color that
  2086. the resulting colormap index actually points to is undefined and visually
  2087. random unless you have actually filled it in yourself. [On many X servers Black
  2088. and White often 0/1 or 1/0; programs taking advantage of this mathematical
  2089. coincidence will break.]
  2090.     If you want to be combining colors with GXxor, then you should be 
  2091. allocating a number of your own color cells and filling them with your chosen
  2092. pre-computed values.
  2093.     If you want to use GXxor simply to switch between two colors, then you 
  2094. can take the shortcut of setting the background color in the GC to 0 and the
  2095. foreground color to a value such that when it draws over red, say, the result 
  2096. is blue, and when it draws over blue the result is red. This foreground value 
  2097. is itself the XOR of the colormap indices of red and blue.
  2098.  
  2099. [Thanks to Chris Flatters (cflatter@zia.aoc.nrao.EDU) and Ken Whaley 
  2100. (whaley@spectre.pa.dec.com), 2/91]
  2101.  
  2102. ----------------------------------------------------------------------
  2103. Subject: 119)  Why does the pixmap I copy to the screen show up as garbage? 
  2104.  
  2105.     The initial contents of pixmaps are undefined.  This means that most
  2106. servers will allocate the memory and leave around whatever happens to be there 
  2107. -- which is usually garbage.  You probably want to clear the pixmap first using
  2108. XFillRectangle() with a function of GXcopy and a foreground pixel of whatever 
  2109. color you want as your background (or 0L if you are using the pixmap as a 
  2110. mask). [courtesy Dave Lemke of NCD and Stuart Marks of Sun]
  2111.  
  2112. ----------------------------------------------------------------------
  2113. Subject: 120)  How can my application iconify itself?
  2114.  
  2115.     The ICCCM provides a mechanism for this; your application sends a
  2116. client message which includes a data value indicating that it wishes to be
  2117. iconified.  Here is a sample callback that will iconify the application shell, 
  2118. wait 3 seconds, and pop it back up. Note that ApplicationShellWidget below
  2119. is global; it would make more sense in real use to walk up the tree via 
  2120. XtParent() to find the shell containing the active widget.
  2121.  
  2122.    void IconifyShell(w, d1, d2)
  2123.         Widget w;
  2124.         caddr_t d1, d2;
  2125.    {
  2126.      XClientMessageEvent event;
  2127.      Window win;
  2128.      Display *dpy;
  2129.  
  2130.      event.type = ClientMessage;
  2131.      event.send_event = True;
  2132.      dpy = event.display = XtDisplay(w);
  2133.      win = event.window = XtWindow(ApplicationShellWidget);
  2134.      event.message_type = XInternAtom(dpy, "WM_CHANGE_STATE", False);
  2135.      event.format = 32;
  2136.      event.data.l[0] = IconicState;
  2137.      XSendEvent(dpy, DefaultRootWindow(dpy), False,
  2138.                 SubstructureRedirectMask | SubstructureNotifyMask, &event);
  2139.      XFlush(dpy);
  2140.      sleep(3);
  2141.      XMapWindow(dpy,win);
  2142.    }
  2143.  
  2144. [courtesy David Brooks (dbrooks@osf.osf.org), 4/90]
  2145.  
  2146. R4 users may find it easier to use this routine:
  2147.     /*
  2148.      * This function instructs the window manager to change this window from
  2149.      * NormalState to IconicState.
  2150.      */
  2151.     Status XIconifyWindow (dpy, w, screen)
  2152.         Display *dpy;
  2153.         Window w;
  2154.         int screen;
  2155.  
  2156. ----------------------------------------------------------------------
  2157. Subject: 121)  How do I check whether a window ID is valid?
  2158. My program has the ID of a window on a remote display. I want to check whether
  2159. the window exists before doing anything with it.
  2160.  
  2161.     Because X is asynchronous, there isn't a guarantee that the window would
  2162. still exist between the time that you got the ID and the time you sent an event
  2163. to the window or otherwise manipulated it. What you should do is send the event
  2164. without checking, but install an error handler to catch any BadWindow errors, 
  2165. which would indicate that the window no longer exists. This scheme will work 
  2166. except on the [rare] occasion that the original window has been destroyed and 
  2167. its ID reallocated to another window.
  2168.  
  2169. [courtesy Ken Lee (klee@wsl.dec.com), 4/90]
  2170.  
  2171. ----------------------------------------------------------------------
  2172. Subject: 122)  Why can't my program work with tvtwm or swm?
  2173.  
  2174.     A number of applications, including xwd, xwininfo, and xsetroot, do not
  2175. handle the virtual root window which tvtwm and swm use; they typically return 
  2176. the wrong child of root. A general solution is to add this code or to use it in
  2177. your own application where you would normally use RootWindow(dpy,screen):
  2178.  
  2179. /* Function Name: GetVRoot
  2180.  * Description: Gets the root window, even if it's a virtual root
  2181.  * Arguments: the display and the screen
  2182.  * Returns: the root window for the client
  2183.  */
  2184. #include <X11/Xatom.h>
  2185. Window GetVRoot(dpy, scr)
  2186. Display        *dpy;
  2187. int             scr;
  2188. {
  2189. Window          rootReturn, parentReturn, *children;
  2190. unsigned int    numChildren;
  2191. Window          root = RootWindow(dpy, scr);
  2192. Atom            __SWM_VROOT = None;
  2193. int             i;
  2194.  
  2195.   __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False);
  2196.   XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren);
  2197.   for (i = 0; i < numChildren; i++) {
  2198.     Atom            actual_type;
  2199.     int             actual_format;
  2200.     long            nitems, bytesafter;
  2201.     Window         *newRoot = NULL;
  2202.  
  2203.     if (XGetWindowProperty(dpy, children[i], __SWM_VROOT, 0, 1,
  2204.         False, XA_WINDOW, &actual_type, &actual_format, &nitems,
  2205.             &bytesafter, (unsigned char **) &newRoot) == Success && newRoot) {
  2206.             root = *newRoot;
  2207.             break;
  2208.         }
  2209.     }
  2210.  
  2211.     return root;
  2212. }
  2213.  
  2214. [courtesy David Elliott (dce@smsc.sony.com). Similar code is in ssetroot, a
  2215. version of xsetroot distributed with tvtwm. 2/91]
  2216.  
  2217. A header file by Andreas Stolcke of ICSI on export.lcs.mit.edu:contrib/vroot.h 
  2218. functions similarly by providing macros for RootWindow and DefaultRootWindow;
  2219. code can include this header file first to run properly in the presence of a
  2220. virtual desktop.
  2221.     
  2222. ----------------------------------------------------------------------
  2223. Subject: 123)  Can I have two applications draw to the same window?
  2224.  
  2225.     Yes. The X server, primarily, assigns IDs to windows and other 
  2226. resources, and any application that knows the ID can manipulate the resource.
  2227.     The problem you face is how to disseminate the window ID to multiple 
  2228. applications. A simple way to handle this (and which solves the problem of the
  2229. applications' running on different machines) is in the first application to 
  2230. create a specially-named property on the root-window and put the window ID into 
  2231. it. The second application then retrieves the property, whose name it also
  2232. knows, and then can draw whatever it wants into the window.
  2233.     [Note: this scheme works iff there is only one instance of the first
  2234. application running, and the scheme is subject to the limitations mentioned
  2235. in the Question about using window IDs on remote displays.]
  2236.     Note also that you will still need to coordinate any higher-level 
  2237. cooperation among your applications. 
  2238.     Note also that two processes can share a window but should not try to 
  2239. use the same server connection. If one process is a child of the other, it 
  2240. should close down the connection to the server and open its own connection.
  2241.  
  2242. [mostly courtesy Phil Karlton (karlton@wpd.sgi.com) 6/90]
  2243.  
  2244. ----------------------------------------------------------------------
  2245. Subject: 124)  How do I keep a window from being resized by the user?
  2246.  
  2247.     Resizing the window is done through the window manager; window managers
  2248. can pay attention to the size hints your application places on the window, but 
  2249. there is no guarantee that the window manager will listen. You can try setting 
  2250. the minimum and maximum size hints to your target size and hope for the best. 
  2251. [1/91]
  2252.  
  2253. ----------------------------------------------------------------------
  2254. Subject: 125)  How do I render rotated text?
  2255.     
  2256.     Xlib intentionally does not provide such sophisticated graphics 
  2257. capabilities, leaving them up to server-extensions or clients-side graphics
  2258. libraries.
  2259.     Your only choice, if you want to stay within the core X protocol, is to
  2260. render the text into a pixmap, read it back via XGetImage(), rotate it "by hand"
  2261. with whatever matrices you want, and put it back to the server via XPutImage();
  2262. more specifically:
  2263.     1) create a bitmap B and write your text to it.
  2264.     2) create an XYBitmap image I from B (via XGetImage).
  2265.     3) create an XYBitmap Image I2 big enough to handle the transformation.
  2266.     4) for each x,y in I2, I2(x,y) = I(a,b) where 
  2267.         a = x * cos(theta) - y * sin(theta)
  2268.         b = x * sin(theta) + y * cos(theta)
  2269.     5) render I2
  2270.     Note that you should be careful how you implement this not to lose
  2271. bits; an algorithm based on shear transformations may in fact be better.
  2272.     The high-level server-extensions and graphics packages available for X 
  2273. also permit rendering of rotated text: Display PostScript, PEX, PHIGS, and GKS,
  2274. although most are not capable of arbitrary rotation and probably do not use the
  2275. same fonts that would be found on a printer.
  2276.     In addition, if you have enough access to the server to install a font
  2277. on it, you can create a font which consists of letters rotated at some
  2278. predefined angle. Your application can then itself figure out placement of each
  2279. glyph.
  2280.  
  2281. [courtesy der Mouse (mouse@larry.mcrcim.mcgill.edu), Eric Taylor 
  2282. (etaylor@wilkins.bmc.tmc.edu), and Ken Lee (klee@wsl.dec.com), 11/90;
  2283. Liam Quin (lee@sq.com), 12/90]
  2284.  
  2285.     InterViews (C++ UI toolkit, in the X contrib software) has support for
  2286. rendering rotated fonts in X.  It could be one source of example code.
  2287. [Brian R. Smith (brsmith@cs.umn.edu), 3/91]
  2288.  
  2289. ----------------------------------------------------------------------
  2290. Subject: 126)  Why can't my program get a standard colormap?
  2291. I have an image-processing program which uses XGetRGBColormap() to get the 
  2292. standard colormap, but it doesn't work. 
  2293.  
  2294.     XGetRGBColormap() when used with the property XA_RGB_DEFAULT_MAP does 
  2295. not create a standard colormap -- it just returns one if one already exists.
  2296. Use xstdcmap or do what it does in order to create the standard colormap first.
  2297.  
  2298. [1/91; from der Mouse (mouse@larry.mcrcim.mcgill.edu)]
  2299.  
  2300. ----------------------------------------------------------------------
  2301. Subject: 127)  What is the X Registry? (How do I reserve names?)
  2302.  
  2303.     There are places in the X Toolkit, in applications, and in the X
  2304. protocol that define and use string names. The context is such that conflicts
  2305. are possible if different components use the same name for different things.
  2306.     The MIT X Consortium maintains a registry of names in these domains:
  2307. orgainization names, selection names, selection targets, resource types,
  2308. application classes, and class extension record types; and several others.
  2309.     The list as of 1/90 is in the directory mit/doc/Registry on the R4 tape.
  2310.     To register names (first come, first served) or to ask questions send 
  2311. to xregistry@expo.lcs.mit.edu; be sure to include a postal address for
  2312. confirmation.
  2313.  
  2314. [11/90; condensed from Asente/Swick Appendix H]
  2315.  
  2316.