Dec 262017
 
Frequently Asked Questions FAQ about X-Windowing system. This is a collection of several FAQs including performance, general, and 386 specific FAQs about X, a *must* read by those wishing to use X Windows under Linux.

Full Description of File


Collection of several FAQs about the X
windowing system including performance
FAQ, 386 FAQ, and general FAQ etc. This
is a *must* read for Linux X-heads.


File XFAQ32.ZIP from The Programmer’s Corner in
Category UNIX Files
Frequently Asked Questions FAQ about X-Windowing system. This is a collection of several FAQs including performance, general, and 386 specific FAQs about X, a *must* read by those wishing to use X Windows under Linux.
File Name File Size Zip Size Zip Type
FILE_ID.DIZ 159 131 deflated
XWINFAQ.TXT 343200 122799 deflated

Download File XFAQ32.ZIP Here

Contents of the XWINFAQ.TXT file


From: [email protected] (Steve Kotsopoulos)
Subject: X on Intel-based Unix Frequently Asked Questions [FAQ] (with answers)
Summary: X options for Intel-based Unix (SYSV/386, 386BSD, Linux, Mach)
Date: 1 Feb 93 21:31:55 GMT
Expires: Mon, 1 Mar 1993 05:00:00 GMT
Reply-To: [email protected]

Archive-name: Intel-Unix-X-faq
Last-modified: 1 Feb 1992

Note: This is a major re-organization (and replacement) of my
"Frequently Asked Questions About X386" FAQ list.

This article includes answers to:

I) What options do I have for X software on my Intel-based Unix system?
1. Free options
2. Commercial options
II) What is XFree86 and where do I get it?
3. What is XFree86?
4. What OSs are supported?
5. What video hardware is supported?
6. What about accelerated boards?
7. Why doesn't XFree86 support 16-color VGA modes?
8. What other hardware or software requirements are there?
9. Where can I get source for XFree86?
10. Where can I get binaries for XFree86?
IV) What general things should I know about running XFree86?
11. Installation directories
12. Configuration files
13. Determining VGA dot clocks and monitor modes
14. Rebuilding/reconfiguring the server from the link kit
V) What OS-specific things should I know about running XFree86?
15. SVR4
16. SVR3
17. 386BSD
18. Linux
19. Mach
VI) What general things should I know for building XFree86 from source?
20. Disk space requirements
21. README files to take note of
22. Compiler recommendations
VII) What OS-specific things should I know for building XFree86 from source?
23. SVR4
24. SVR3
25. 386BSD
26. Linux
27. Mach
VIII) Is there anything special about building clients with XFree86?
28. BSD compatibility library
29. ANSICCOPTIONS

This article does NOT include answers to general X questions, since these
are already covered by the X FAQ that is regularly posted by David B. Lewis
.

If you have anything to add or change on the FAQ just let me know.
(especially if you had a problem that someone else was able to help you with)
Send changes to [email protected], please put 'FAQ' somewhere
in the subject line so that my mail filter will put it in the correct
mail folder.

Please DO NOT ask me questions that are not answered in the FAQ. I do not
have time to respond to these individually. Instead, post your question
to the net, and send me the question and answer together when you get it.

Frequently Asked Questions About X on Intel-based Unix (with answers)
=====================================================================

I) What options do I have for X software on my Intel-based Unix system?

1. Free options
The BEST option is XFree86, which is an enhanced version of X386 1.2.
Any other version of X386 will have slower performance, and will
be more difficult to compile. Information on how to obtain XFree86
is listed below.

X386 is the port of the X11 server to System V/386 that was
done by Thomas Roell ([email protected]).
It supports a wide variety of SVGA boards.
There are 2 major free versions: X386 1.1 is based on X11R4,
X386 1.2 is included in MIT's X11R5 distribution (ie. you
don't need to patch it into the MIT source any more).
X386 1.3 is the current commercial offering from SGCS (see below).

2. Commercial options

1) Metro Link
2213 W. McNab Road
Pompano Beach, FL 33069
(305) 970-7353
Fax: (305) 970-7351
email: [email protected]

Summary: OS: SVR3.2, SVR4, Venix
HW: EGA, VGA, SVGA, TIGA, TARGA, 8514/A, S3
Other: Motif, OpenLook/XView, XIE Imaging Extension

2) SGCS (Snitily Graphics Consulting Services)
894 Brookgrove Lane
Cupertino, CA 95014
(800) 645-5501, (408) 255-9665
Fax: (408) 255-9740
email: [email protected] or ...!mips!zok!info

Summary: OS: SVR3.2, SVR4
HW: 8514/A (ATI Ultra), S3 (Diamond Stealth), SVGA
Other: Motif, Dual-headed server

3) Consensys Corporation
1301 Pat Booker Rd.
Universal City, TX 78148
Phone: 1-800-388-1896
FAX: 1-416-940-2903
email: [email protected]

Summary: OS: Consensys V4.2, Consensys' version of
Unix System V Release 4.2
HW: X11R4 server support for VGA, SVGA
Other: MoOLIT, Motif, X11R5 Clients

4) The Santa Cruz Operation, Inc.
p.o. box 1900
Santa Cruz, California 95061
(408) 425 7222, (800) SCO UNIX,
FAX: (408) 458 4227
email: [email protected]

Summary: OS: ODT 1.1, ODT 2.0, SCO Unix 3.2v4
HW: X11R4 server support for SVGA, 8514/A, S3, TMS340x0,
WD90C31, XGA2, assorted local bus (see SCO Hardware
Compatabilty Guide for actual card vendors).
Other: Motif

NOTE: Other commercial vendors (including OS vendors describing
bundled software) are welcome to submit summary information
summary information such as the above.

II) What is XFree86 and where do I get it?

3. What is XFree86?

XFree86 is an enhanced version of X386 1.2, which was distributed with
X11R5. This release consists of many bug fixes, speed improvements, and
other enhancements. Here are the highlights of the enhancements:

1) The SpeedUp package from Glenn Lai is an integral part of XFree86,
selectable at run-time via the Xconfig file. Some SpeedUps require
an ET4000 based SVGA, and others require a virtual screen width of
1024. The SpeedUps suitable to the configuration are selected by
default. Depending on the underlying hardware, these enhancements
can provide as much as a 50% improvement in xStones.
2) The fX386 packages from Jim Tsillas are included as the default
operating mode if SpeedUp is not selected. This mode is now
equivalent in performance to X386 1.1b (X11R4).
3) Support for LOCALCONN, compile-time selectable for server, clients,
or both. This support is for both SVR3.2 and SVR4. For SVR4.0.4
with the 'Advanced Compatibility Package', local connections from
SCO XSight/ODT clients are supported.
4) Support for the newer ET4000-based SVGAs which have high clocks and
reported incorrect clock values with the standard version. This
support is automatic and does not require any Xconfig options.
Note that the Diamond SpeedStar 24 (as opposed to the 24X) is an
ET4000 board that is NOT compatible with XFree86 (in addition, the
SpeedStar 24X does not use an ET4000, and is also not supported).
5) Support for compressed bitmap fonts has been added (Thomas Eberhardt's
code from the contrib directory on export.lcs.mit.edu).
6) Integrated support for 386BSD, Mach, and Linux.
7) A monochrome version of the server which will run on generic VGA
cards is now included. This server uses just 64k of the memory on
the VGA, and hence is limited to a virtual screen of approx. 800x600.
8) New configuration method which allows the server's drivers and font
renderers to be reconfigured from both source and binary
distributions.

Also included are a tutorial on monitor timing by Bob Crosson, and the
current X386 mode database and a sample xdm configuration by David Wexelblat.

4. What OSs are supported?

XFree86 supports:
SVR4: Microport, Dell, Esix, ISC, AT&T, MST, Consensys, UHC
SVR3: ISC 2.2 & 3.0, AT&T 2.2
Linux, Mach, 386BSD

BSD/386 is not supported, but it should work. The most active
BSD/386 person is Greg Lehey .

Note that Esix 3.2D and SCO are not supported yet,
but anyone should feel free to submit patches.
If you are interested in tackling this, send mail to
[email protected]

5. What video hardware is supported?

ET4000(Tseng)
ET3000(Tseng)
PVGA1(Paradise)
WD90Cxx(Western Digital - Paradise PVGA1 Supersets)
GVGA(Genoa)
TVGA8900C(Trident)
ATI18800,28800(ATI SVGA - not 8514!)

If you are purchasing new hardware for the purpose of using XFree86, it
is suggested that you purchase an ET4000-based board such as the
Orchid ProDesigner IIs. Avoid recent Diamond boards; XFree86 will not
work with them, because Diamond won't provide programming details.
In fact, the XFree86 project is actively not supporting new Diamond
products, as long as such policies remain in effect. Contributions
of code will NOT be accepted (because of the potential liabilities).
If you would like to see this change, tell Diamond about it.

6. What about accelerated boards?

At this time, there is no support for accelerated boards like the
S3, ATI Ultra (8514/A), TIGA, etc. This support is available in
commercial products from SGCS and MetroLink (for SVR3 and SVR4).

A beta S3 server is available for 386BSD. Contact
A beta 8514/A server is available for Linux. Contact
or . Note: these servers are NOT part of XFree86.

7. Why doesn't XFree86 support 16-color VGA modes?

The reason that this is not supported is the way VGA implements the
16-color modes. In 256-color modes, each byte of frame buffer memory
contains 1 pixel. But the 16-color modes are implemented as bit-
planes. Each byte of frame- buffer memory contains 1 bit from each
of each of 8 pixels, and there are four such planes. The MIT frame-
buffer code is not designed to deal with this. If VGA handled
16-color modes by packing 2 4-bit pixels into each byte, the MIT code
could be modified to support this (or it already may; I'm not sure).
But for the VGA way of doing things, a complete new frame-buffer
implementation is required. And it's not something the XFree86
Core Team wants to tackle.

8. What other hardware or software requirements are there?

Obviously, a supported SVGA board and OS are required. To run
X efficiently, 12-16MB of memory should be considered a minimum.
The various binary releases take 10-40MB of disk space, depending
on the OS (e.g. whether or not it supports shared libraries).
To build from sources, at least 80MB of free disk space will
be required, although 120MB should be considered a comfortable
lower bound.

9. Where can I get source for XFree86?

Source patches for the current version (1.1, based on X11R5 PL17
from MIT), are available via anonymous FTP from:
export.lcs.mit.edu (under /contrib/XFree86)
ftp.physics.su.oz.au (under /XFree86)
ftp.win.tue.nl (under /pub/XFree86)
(For the rest of this FAQ, these 3 location will be called $FTP)

Refer to the README file under the specified directory for information
on which files you need to get to build your distribution.

10. Where can I get binaries for XFree86?

Binaries are available via anonymous FTP from:
ftp.physics.su.oz.au- SVR4 binaries
under /XFree86/SVR4
ftp.win.tue.nl- SVR4 binaries
under /pub/XFree86/SVR4
ferkel.ucsb.edu- SVR4 binaries
under /pub/SVR4/XFree86
stasi.bradley.edu- SVR4 binaries
under /pub/XFree86/SVR4
blancmange.ma.utexas.edu- SVR3 (ISC) binaries
under /pub/ISC/XFree86-1.1
tsx-11.mit.edu- Linux binaries
under /pub/linux/packages/X11/xfree86-1.1
agate.berkeley.edu- 386BSD binaries
under /pub/386BSD/0.1-ports/XFree86
nova.cc.purdue.edu- 386BSD binaries
under /pub/386bsd/submissions/XFree86
ftp.cs.uwm.edu- Mach binaries
under /i386

Each binary distribution will contain a README file that describes
what files you need to take from the archive, and which compile-time
option selections were made when building the distribution.

IV) What general things should I know about running XFree86?

11. Installation directories

The top-level installation directory is specified by the ProjectRoot
(/usr/X386, by default) variable in config/site.def. Binaries, include
files, and libraries are installed in $ProjectRoot/{bin,include,lib}.

This can be changed when rebuilding from sources, and can be modified
via symbolic links for those OSs that support them. This directory is
nonstandard, and was chosen this way to allow XFree86 to be installed
alongside a commercial/vendor-supplied X implementation.

12. Configuration files

The XFree86 server reads a configuration file ("Xconfig") on startup.
The search path, contents and syntax for this file are documented in
the server manpage, which should be consulted before asking questions.

13. Determining VGA dot clocks and monitor modes

David E Wexelblat ([email protected]) maintains a database of known
clock settings for VGA cards and monitor settings.
The database is installed in /usr/X386/lib/X11/etc/modeDB.txt, and
is in the source tree under mit/server/ddx/x386/etc. This database is
also available from him (for the latest copy), and is kept on
export.lcs.mit.edu in ~/contrib/X386.modeDB.Z, which is updated
occasionally. Obtain a copy of this database. It just might have the
settings you need. If you create new settings, please send them to
David for inclusion in the database.

If this doesn't help you, the CONFIG and Xconfig.Notes files with
XFree86 contains tutorials on how to come up with these timings. It
may be helpful to start with settings that almost work, and use this
description to get them right. When you do, send the information to
David Wexelblat for inclusion in the database.

NOTE: The old 'clock.exe' program is not supported any more, and
is completely unnecessary. If you need to determine dot
clock values for a new board, remove the 'Clocks' line from
your Xconfig file (if present), and start the server. The
server will probe for clocks itself and print them out.
You can use these values to put a 'Clocks' line into your
Xconfig file, which is not necessary, but will speed up
starting the server in the future.

14. Rebuilding/reconfiguring the server from the link kit

If you have installed the server Binary Link Kit, it is possible to
reconfigure the drivers and font renderers in the server. This is
fully explained in the README file that is available with the link kit.

V) What OS-specific things should I know about running XFree86?

First of all, the server must be installed suid-root (mode 4755).

15. SVR4
Why won't my xterm run properly?

If your kernel is not built with the consem module, you should define
CONSEM=no in you environment. Otherwise xterm won't run.
csh users should use 'setenv CONSEM no'

The Esix console driver patch 403019 is known to cause keymapping
problems with XFree86. It recommended that this patch not be
installed. Alternatively they keymap can be fixed with xmodmap.

16. SVR3

Make sure you look at $FTP/README.ISC, if that's what you are running.

17. 386BSD

Make sure you look at $FTP/README.386BSD.

1) What if after xdm, twm and xterm start up and run ok, the keyboard
freezes and i have to reboot?

If the server crashes and fails to put the keyboard back in ascii
mode (e.g. your keyboard is dead but remote logins are fine), you
can reset it by 'kbd_mode -a' from a remote login. Likewise, if a
rogue program put the keyboard in ascii mode while the server is
running, the keyboard will need to be reset using 'kbd_mode -u'.

2) What do I do if xdm reports 'Crypt not present in system' or xdm
won't accept my password?

If you are using the xdm binary from core-bin-1.1.tar.Z on agate,
make sure your passwords are unencrypted. Use vipw to check the
password file -- you should see the unencrypted passwords there.
If so, ignore the 'Crypt not present in system' message.

Why? 386BSD 0.1's stock crypt routine is a dummy (crypt_dummy.c)
that prints this message whenever you invoke it. This message
merely tells you that passwords are unencrypted.

This dummy crypt is staticly linked into xdm in core-bin-1.1.tar.Z
on agate, and export restrictions prevent us from providing
binaries with a real crypt. If you need xdm with a working crypt,
you will have to get the XFree86 distribution and rebuild xdm.
Chris Demetriou's /usr/386bsd.errata/crypt.instructions tells you
how to install a real crypt.

[ thanks to [email protected] for these suggestions ]

18. Linux

You must be running Linux 0.97pl4 or greater, and have the 4.1 gcc
jump libraries installed.

Make sure the binaries X386, X386mono, xload and xterm are setuid root.

If your kernel doesn't have TCP support compiled in, you'll have to
run the server as "X -pn". The default startup configuration assumes
that TCP is not available. If it is, change the two files
/usr/X386/bin/startx and /usr/X386/lib/X11/xdm/Xservers, removing the
-pn argument to X386.

Make sure /dev/console is either a link to /dev/tty0 or has the major
number 4, minor number 0. Also note that if /dev/console is not
owned by the user running X, then xconsole and xterm will not permit
console output redirection. Xdm will properly change the owner, but
startx won't.

When running xdm from rc.local, you will need to provide it with
a tty, for example "xdm < /dev/console &".

For more detailed information, please read the file README present
with the distribution on tsx-11.mit.edu.

19. Mach

Make sure you look at $FTP/README.Mach.

VI) What general things should I know for building XFree86 from source?

20. Disk space requirements

- about 60-70MB of free disk space is required for building XFree86. An
additional 20-30MB is required to install the built binaries,
- If you don't want to build PEX and/or want to minimize disk usage,
you can remove some or all of the following directories:

mit/doc mit/hardcopy
mit/demos/auto_box mit/extensions/lib/PEX
mit/demos/beach_ball mit/extensions/server/PEX
mit/demos/gpc mit/extensions/test/InsPEX
mit/fonts/PEX mit/lib/CLX
mit/server/ddx/dec mit/server/ddx/ibm
mit/server/ddx/macII mit/server/ddx/mips
mit/server/ddx/omron mit/server/ddx/snf
mit/server/ddx/sun mit/server/ddx/tek
mit/util/PEX

The following large fonts in mit/fonts/bdf/misc can also be removed:

k14.bdf hang*.bdf jiskan*.bdf

21. README files to take note of

$FTP/README, as well as any system-specific README file.
Also read through 'site.def'. There are lots of documented options
that can be changed from their defaults by editing this file.

22. Compiler recommendations

gcc 2.? is *strongly* recommended for building server, libs, clients.
In most cases it generates faster code than the standard compiler, and
for those with a 486, its -m486 flag can provide an additional 5%
improvement. The resulting executables will be larger, but can still
be run on a 386 CPU with no loss in performance.

VII) What OS-specific things should I know for building XFree86 from source?

23. SVR4

You may need to re-tune your kernel (see the README file).
Don't use csh, use ksh instead.

24. SVR3

Make sure you look at $FTP/README.ISC, if that's what you are running.

25. 386BSD

Make sure you look at $FTP/README.386BSD.

26. Linux

Some Makefiles in the server are automatically generated based on
configuration options. Under Linux, these automatic makes do not
perform the "make depend" step. To turn that back on, change the
definition of "Depend" in x386.cf from "emptyrule" to "depend".

Makedepend is a shell script that uses ed. The public domain version
of ed used in linux has a line length limit of 512 characters,
and mit/lib/X has one line of 1500 characters, causing make to fail.
Recompiling ed with a line limit of 2048 will avoid this problem.
[ Thanks to for this suggestion ]

To create private jump libraries, use the tools in the gcc shlib
subdirectory. Change the Makefile appropriately and type "make X11".

For more detailed information, please read the file README present
with the distribution on tsx-11.mit.edu.

27. Mach

Make sure you look at $FTP/README.Mach.

VIII) Is there anything special about building clients with XFree86?

28. BSD compatibility library

A lot of clients make use of BSD functions like bcopy(), etc.
The default configuration files are set up to link with libXbsd.a
which contains emulation for bcopy(), bzero(), bcmp(), ffs(), random(),
seed(). A better way of providing the 'b' functions is to include
in source files that call them. Xfuncs.h provides macro
definitions for these in terms of the SYSV 'mem' functions. If you are
linking with a vendor supplied library which calls some of these
functions, then you should link with libXbsd.a

29. ANSICCOPTIONS

This is something that was added to allow a developer to get rid of the
ANSI-ness defined in the default CCOPTIONS without having to rewrite
the entire CCOPTIONS line. For example, with stock MIT, you'd see
something like
CCOPTIONS="-ansi -O2 -fwritable-strings"
and to get rid of the ANSI-ness, the developer would have to put
CCOPTIONS="-O2 -fwritable-strings"
in his Imakefile. With this change, you would see a default of
ANSICCOPTIONS="-ansi"
CCOPTIONS="-O2 -fwritable-strings"
and all the developer would have to put in the Imakefile is:
ANSICCOPTIONS=
to get rid of the ANSI-ness (many X clients will die a horrible death
with -ansi). The effect is even more dramatic in practice, because
CCOPTIONS is actually quite complex. The other issue is that one must
add 'ANSICCOPTIONS=$(ANSICCOPTIONS)' to a PassCDebugFlags definition.

CONTACT INFORMATION

Ongoing development planning and support is coordinated by the XFree86
Core Team. At this time the Core Team consists of:

The original "gang of four":
David Dawes
Glenn Lai
Jim Tsillas
David Wexelblat

Those supporting non-SYSV operating systems:
Robert Baron [Mach]
Rich Murphey [386BSD]
Orest Zborowski [Linux]

e-mail sent to will reach all of the core team.

--------------------------------------------------

Thanks to all the people who already sent me corrections or additions.
--
Steve Kotsopoulos mail: [email protected]
Systems Analyst bitnet: [email protected]
Engineering Computing Facility uucp: uunet!utai!ecf!steve
University of Toronto phone: (416) 978-5898

Summary: Answers about the X11 Window System widgets and Xt Intrinsics library
Date: 4 Feb 93 15:48:51 GMT
Reply-To: [email protected]
Followup-To: comp.windows.x.intrinsics

Archive-name: Xt-FAQ
Version: $Id: FAQ-Xt,v 1.26 93/02/04 10:48:13 ware Exp $

The X Toolkit Intrinsics F.A.Q
A monthly posting


This article contains the answers to some Frequently Asked Questions
(FAQ) from comp.windows.x about the X Toolkit Intrinsics. To submit
questions (preferably with an answer) send email to: [email protected]

Many FAQs, including this one, are available on the archive site
rtfm.mit.edu in the directory pub/usenet/news.answers. The name
under which a FAQ is archived appears in the Archive-name
line at the top of the article. This FAQ is archived as Xt-FAQ.

All code fragments are public domain.

Contents
0. Xt Glossary
1. Software Versions
2. Related FAQ's
3. Why does my application core dump when I use signals/alarms/cthreads?
4. How do I use a different visual than the default?
5. Which visual should an application use?
6. Why do only Shell widgets have a Visual?
7. Which visual, depth and colormap do Shells inherit?
8. I've done all the above and I still get a BadMatch error. Why?
9. Why doesn't my widget get destroyed when I call XtDestroyWidget()?
10. How do I exit but still execute the DestroyCallbacks?
11. How do I resize a Shell widget?
12. Why can't XtAppAddInput() handle files?
13. What good books and magazines are there on Xt?
14. What Widgets are available?
15. What alternatives to the Intrinsics are there?
16. How do I pass a float value to XtSetValues?
17. How do I write a resource converter?
18. How do I open multiple displays?
19. What changed from R3 to R4 to R5?
20. Where are the resources loaded from?
21. What order are callbacks executed in?
22. How do I know if a widget is visible?
23. How do I reparent a widget in Xt, i.e. XtReparentWidget()?
24. Why use XtMalloc, XtFree, etc?
25. How to debug an Xt application?

The "+++" indicates the question needs more of an answer.

----------------------------------------------------------------------
0. Xt Glossary
----------------------------------------------------------------------

o The Xt Intrinsics implement an object oriented interface to C code
to allow useful graphical components to be created. Included with
this are classes that provide the base functionality: Object,
RectObj, Core, Composite, Constraint, Shell, OverrideShell, WMShell,
etc. The terms "Xt" and "Intrinsics" are used interchangeably,
however, they are used very precisely to mean a specific library of the X
window system. In particular, it does not include the Athena,
Motif, OLIT or any other widget set. Without further widgets the
Intrinsics are not especially useful.

o A widget refers to a user interface abstraction created via Xt. The
precise use, is any object that is a subclass of the Core class. It
is used loosely to refer to anything that is a subclass of the
Object class although these are more accurately called windowless
widgets or gadgets.

o Xlib is the C interface to the X11 protocol. It is one layer below
the Xt Intrinsics. Typically a widget uses relatively few Xlib
functions because Xt provides most such services although an
understanding of Xlib helps with problems.

----------------------------------------------------------------------
1. Software Versions
----------------------------------------------------------------------

The following are the latest versions of Xt based software:
_____________________________________________________________
SoftwareVersionReleasedNext Expected
_____________________________________________________________
X11R4patch 18(none)
X11R5patch 2112/18/92??
Athena Widgets(see X11R5)
Motif1.2.19/92??
OLIT??????
Xtra2.56/15/92??
XwX11R4(none)
XcuX11R5(none)
fwf3.41/11/924/93
_____________________________________________________________

----------------------------------------------------------------------
2. Related FAQ's
----------------------------------------------------------------------
David B. Lewis (uunet!craft!faq) maintains the FAQ on X. It
is posted monthly on comp.windows.x and located on export in contrib/FAQ.

Liam R. E. Quin ([email protected]) posts an FAQ list on Open Look to
comp.windows.x.

Jan Newmarch ([email protected]) posts an FAQ list on Motif
to comp.windows.x.motif.

Peter Ware ([email protected]) posts an FAQ list for
comp.windows.x.intrinsics; it is on export in contrib/FAQ-Xt.

----------------------------------------------------------------------
3. Why does my application core dump when I use signals/alarms/cthreads?
----------------------------------------------------------------------

In brief, Xlib, Xt and most widget sets have no mutual exclusion for
critical sections. Any interrupt handler is likely to leave one of
the above libraries in an inconsistent state -- such as all the
appropriate flags not yet set, dangling pointers, in the middle of a
list traversal, etc. Note that the ANSI C standard points out that
behavior of a signal handler is undefined if the signal handler calls
any function other than signal() itself, so this is not a problem
specific to Xlib and Xt; the POSIX specification mentions other
functions which may be called safely but it may not be assumed that
these functions are called by Xlib or Xt functions.

The only safe way to deal with signals is to set a flag in the
interrupt handler. This flag later needs to be checked either by a
work procedure or a timeout callback. It is incorrect to add either
of these in the interrupt handler. As another note, it is dangerous
to add a work procedure that never finishes. This effectively
preempts any work procedures previously added and so they will never
be called. Another option is to open a pipe, tell the event loop
about the read end using XtAppAddInput() and then the signal handler
can write a byte to the write end of the pipe for each signal.
However, this could deadlock your process if the pipe fills up.

Why don't the Intrinsics deal with this problem? Primarily because it
is supposed to be a portable layer to any hardware and operating
system. Is that a good enough reason -- I don't think so.

Note: the article in The X Journal 1:4 and the example in O'Reilly
Volume 6 are in error.

----------------------------------------------------------------------
4. How do I use a different visual than the default?
----------------------------------------------------------------------

This requires a more complicated answer than it should. A window has
three things that are visual specific -- the visual, colormap and
border pixmap. All widgets have their own Colormap and BorderPixmap
resource; only shell widgets have Visual resources (another questions
deals with why shells have a Visual). The default value of these
resources is CopyFromParent which does exactly what it says. In the
shell widget CopyFromParent gets evalulated as DefaultVisualOfScreen
and DefaultColormapOfScreen. When any one of the three resources is
not properly set, a BadMatch error occurs when the window is
created. They are not properly set because each of the values depends
on the visual being used.

How to get this to work? There are two parts to the answer. The
first is if you want an application to start with a particular visual
and the second is if you want a particular shell within an application
to start with a different visual. The second is actually easier
because the basic information you need is available. The first is a
little harder because you'll need to initialize much of the toolkit
yourself in order to determine the needed information.

/*
* Some sample code to start up an application using something other
* than the default visual.
*
* To compile:
*cc -g visual.c -o visual -lXaw -lXmu -lXt -lXext -lX11 -lm
*
* To run:
*./visual -geometry 300x300 -depth 24 -visual StaticColor -fg blue -bg yellow
*
* you need to move the mouse to get the particular visuals colormap
* to install.
*/

#include
#include
#include

typedef struct
{
Visual*visual;
intdepth;
} OptionsRec;

OptionsRecOptions;

XtResource resources[] =
{
{"visual", "Visual", XtRVisual, sizeof (Visual *),
XtOffsetOf (OptionsRec, visual), XtRImmediate, NULL},
{"depth", "Depth", XtRInt, sizeof (int),
XtOffsetOf (OptionsRec, depth), XtRImmediate, NULL},
};

XrmOptionDescRec Desc[] =
{
{"-visual", "*visual", XrmoptionSepArg, NULL},
{"-depth", "*depth", XrmoptionSepArg, NULL}
};



int
main (argc, argv)
intargc;
char**argv;
{
XtAppContextapp;/* the application context */
Widgettop;/* toplevel widget */
Display*dpy;/* display */
char**xargv;/* saved argument vector */
intxargc;/* saved argument count */
Colormapcolormap;/* created colormap */
XVisualInfovinfo;/* template for find visual */
XVisualInfo*vinfo_list;/* returned list of visuals */
intcount;/* number of matchs (only 1?) */
Argargs[10];
Cardinalcnt;
char*name = "test";
char*class = "Test";

/*
* save the command line arguments
*/

xargc = argc;
xargv = (char **) XtMalloc (argc * sizeof (char *));
bcopy ((char *) argv, (char *) xargv, argc * sizeof (char *));

/*
* The following creates a _dummy_ toplevel widget so we can
* retrieve the appropriate visual resource.
*/
cnt = 0;
top = XtAppInitialize (&app, class, Desc, XtNumber (Desc), &argc, argv,
(String *) NULL, args, cnt);
dpy = XtDisplay (top);
cnt = 0;
XtGetApplicationResources (top, &Options, resources,
XtNumber (resources),
args, cnt);
cnt = 0;
if (Options.visual && Options.visual != DefaultVisualOfScreen (XtScreen (top)))
{
XtSetArg (args[cnt], XtNvisual, Options.visual); ++cnt;
/*
* Now we create an appropriate colormap. We could
* use a default colormap based on the class of the
* visual; we could examine some property on the
* rootwindow to find the right colormap; we could
* do all sorts of things...
*/
colormap = XCreateColormap (dpy,
RootWindowOfScreen (XtScreen (top)),
Options.visual,
AllocNone);
XtSetArg (args[cnt], XtNcolormap, colormap); ++cnt;

/*
* Now find some information about the visual.
*/
vinfo.visualid = XVisualIDFromVisual (Options.visual);
vinfo_list = XGetVisualInfo (dpy, VisualIDMask, &vinfo, &count);
if (vinfo_list && count > 0)
{
XtSetArg (args[cnt], XtNdepth, vinfo_list[0].depth);
++cnt;
XFree ((XPointer) vinfo_list);
}
}
XtDestroyWidget (top);


/*
* Now create the real toplevel widget.
*/
XtSetArg (args[cnt], XtNargv, xargv); ++cnt;
XtSetArg (args[cnt], XtNargc, xargc); ++cnt;
top = XtAppCreateShell ((char *) NULL, class,
applicationShellWidgetClass,
dpy, args, cnt);

/*
* Display the application and loop handling all events.
*/
XtRealizeWidget (top);
XtAppMainLoop (app);
return (0);
}

----------------------------------------------------------------------
5. Which visual should an application use?
----------------------------------------------------------------------

This is a point that can be argued about but one opinion is there is
no way for an application to know the appropriate visual -- it has to
be specified by the user. If you disagree with this then your
application probably falls into the category of always using the
default visual or it is hardware specific and expects some particular
visual such as 24bit TrueColor with an OverlayPlane extension (or some
such).

Why? No application runs in isolation. Depending on the way a server
allocates resources I may not always want your application to run in
TrueColor mode if it is going to mess up my other applications. I may
be very upset if it chooses to run in GreyScale instead of PsuedoColor
or just monochrome.

As an example, on a low end color Sun server there are many different
possible visuals: monochrome, 256 entry colormap, static gray, static
color, and a 3/3/2 TrueColor. The SGI Iris's offer all the above
plus 12 bit TrueColor, 24 bit TrueColor, an Overlay Plane.

----------------------------------------------------------------------
6. Why do only Shell widgets have a Visual?
----------------------------------------------------------------------

This is strictly by convention. It makes it possible for an arbitrary
widget to know that the visual it uses can be found by looking for the
shell widget that is its ancestor and obtaining the visual of that
shell.

A widget can have its own visual resource. If it does, it must have
its own realize method to use the visual when it calls
XCreateWindow(). You should also make this a resource that can be
obtained with XtGetValues() so other widgets can find it. A
reasonable value is probably XtNvisual.

----------------------------------------------------------------------
7. Which visual, depth and colormap do Shells inherit?
----------------------------------------------------------------------

The default value for these resources are set to CopyFromParent. This
is interpreted as the DefaultColormapOfScreen(), DefaultDepthOfScreen()
and the default visual of the screen if the widget has no parent -- i.e.
it is an applicationShellWidgetClass and the root of your widget tree.

If the parent of the widget is not null, then the shell copies
colormap and depth from its parent and uses CopyFromParent as the
visual.

----------------------------------------------------------------------
8. I've done all the above and I still get a BadMatch error. Why?
----------------------------------------------------------------------

Some resource converters improperly cache references. This was
especially true of X11R3 and earlier versions of Motif.

----------------------------------------------------------------------
9. Why doesn't my widget get destroyed when I call XtDestroyWidget()?
----------------------------------------------------------------------

See section 2.8 of the Xt specification.

It eventually does get destroyed, just not immediately. The
Intrinsics destroy a widget in a two-phase process. First it and all
of its children have a flag set that indicate it is being destroyed.
It is then put on a list of widgets to be destroyed. This way any
pending X events or further references to that widget can be cleaned
up before the memory is actually freed. The second phase is then
performed after all callbacks, event handlers, and actions have
completed, before checking for the next X event. At this point the
list is traversed and each widget's memory is actually free()'d, among
other things.

As some further caveats/trivia, the widgets may be destroyed if the
Intrinsics determine that they have no further references to the
widgets on the list. If so, then the phase 2 destruction occurs
immediately. Also, if nested event loops are used, widgets placed on
the destroy list before entering the inner event loop are not
destroyed until returning to the outer event loop.

----------------------------------------------------------------------
10. How do I exit but still execute the DestroyCallbacks?
----------------------------------------------------------------------

The problem is if a simple and entirely reasonable approach to exiting
an application is used, such as calling exit() directly, then a widget
may not have a chance to clean up any external state -- such as open
sockets, temporary files, allocated X resources, etc. (this code for
simplicity reasons assumes only a single toplevel widget):


Widget
ToplevelGet (gw)
Widgetgw;/* widget to find toplevel */
{
Widgettop;

for (top = gw; XtParent (top); top = XtParent (top))
/* empty */;
return (top);
}

void
ExitCallback (gw, closure, call_data)
Widgetgw;/* widget */
XtPointerclosure;/* data the app specified */
XtPointercall_data;/* widget specific data */
{
Widgettoplevel;

toplevel = ToplevelGet (gw);
XtUnmapWidget (toplevel);/* make it disappear quickly */
XtDestroyWidget (toplevel);
exit (0);
}

One can see that the above code exit's immediately after destroying
the toplevel widget. The trouble is the phase 2 destruction may never
occur.

This works for most widgets and most applications but will not work
for those widgets that have any external state. You might think that
since it works now it will always work but remember that part of the
reason an object oriented approach is used is so one can be ignorant
of the implementation details for each widget. Which means that the
widget may change and someday require that some external state is
cleaned up by the Destroy callbacks.

One alternative is to modify ExitCallback() to set a global flag and
then test for that flag in a private event loop. However, private
event loops are frowned upon because it tends to encourage sloppy, and
difficult to maintain practices.

Try the following code instead.

#include

extern Widget ToplevelGet (
#if NeedFunctionPrototypes
Widgetgw
#endif
);

extern Boolean ExitWorkProc (
#if NeedFunctionPrototypes
XtPointerclosure
#endif
);

extern void ExitCallback (
#if NeedFunctionPrototypes
Widgetgw,
XtPointerclosure,
XtPointercall_data
#endif
);

Widget
ToplevelGet (gw)
Widgetgw;/* widget to find toplevel */
{
Widgettop;

for (top = gw; XtParent (top); top = XtParent (top))
/* empty */;
return (top);
}


void
ExitCallback (gw, closure, call_data)
Widgetgw;/* widget */
XtPointerclosure;/* data the app specified */
XtPointercall_data;/* widget specific data */
{
Widgettoplevel;

toplevel = ToplevelGet (gw);
XtUnmapWidget (toplevel);/* make it disappear quickly */
XtDestroyWidget (toplevel);
XtAppAddWorkProc (XtWidgetToApplicationContext (gw),
ExitWorkProc, (XtPointer) NULL);
}

Boolean
ExitWorkProc (closure)
XtPointerclosure;
{
exit (0);
/*NOTREACHED*/
}


ExitCallback() adds a work procedure that will get called when the
application is next idle -- which happens after all the events are
processed and the destroy callbacks are executed.

----------------------------------------------------------------------
11. How do I resize a Shell widget?
----------------------------------------------------------------------

After it is realized, one doesn't resize a Shell widget. The proper
thing is to resize the currently managed child of the Shell widget
using XtSetValues(). The geometry change is then propagated to the
Shell which asks the window manager which may or may not allow the
request. However, the Shell must have the resource
XtNallowShellResize set to True otherwise it will not even ask the
window manager to grant the request and the Shell will not resize.

To change the position of a Shell, use XtSetValues() on the Shell, not
the child, and within the limits of the window manager it should be granted.

----------------------------------------------------------------------
12. Why can't XtAppAddInput() handle files?
----------------------------------------------------------------------

It does, however Unix semantics for when I/O is ready for a file does
not fit most peoples' intuitive model. In Unix terms a file
descriptor is ready for reading whenever the read() call would not
block, ignoring the setting of optional flags that indicate not to
block. This works as expected for terminals, sockets and pipes. For
a file the read() will always return but the return indicates an EOF
-- i.e. no more data. The result is the code in the Intrinsics always
calls the input handler because it always thinks something is about to
be read. The culprit is the select() system call or on SYSV based
OS's it is the poll() system call.

How to get around this on a Unix system? The best approach is to use
another process to check for available input on the file. Use a pipe
to connect the application with this other process and pass the file
descriptor from the pipe to XtAppAddInput(). A suitable program on
BSD systems is "tail -f filename".

It's rumored that select() on some systems is not _completely_
reliable. In particular:

- IBM AIX 3.1: this is one where it would work for a while
(several thousand times) and then stop until some other
event woke it up. This seemed to be the result of a race
condition in the Kernel. IBM claims to have a fix for this.

- Pyramid, doesn't work at all.

- Ultrix (and possibly others where pipes are implemented as
sockets), wasn't completely broken, but although the writing
side wrote in 512 byte blocks the reading side received it
all broken up as if it was being put into the pipe a byte at
a time. You can waste a lot of time by reading small blocks
(get raound it by detecting the situation and having
select() ignore the pipe for 10 mseconds - by then it had
been given the whole block).


Note that all the above descriptions used Unix terminology such as
read(), file descriptor, pipes, etc. This is an OS dependent area and
may not be identical on all systems. However the Intrinsic designers
felt it was a common enough operation that it should be included with
part of the toolkit. Why they didn't also deal with signals at this
point I don't know.

----------------------------------------------------------------------
13. What good books and magazines are there on Xt?
----------------------------------------------------------------------

I have a favorite that is the definitive reference. To my perspective
it offers a reasonable introduction but also goes into the full
details of the Intrinsics. When I started using it I was already
familiar with Xt and the concepts behind it, so newcomers may or may
not find it useful. I've always found it accurate and complete, which
means its a 1000 pages.

Asente, Paul J., and Swick, Ralph R., "X Window System Toolkit, The
Complete Programmer's Guide and Specification", Digital Press,
1990, ISBN 1-55558-051-3, order number EY-E757E-DP; and by
Prentice-Hall, ISBN 0-13-972191-6. Also available through DEC
Direct at 1-800-DIGITAL.

The other book I commonly recomend to novices is:

Young, Doug. "The X Window System: Applications and Programming with
Xt (Motif Version)," Prentice Hall, 1989 (ISBN 0-13-497074-8).
(ISBN 0-13-972167-3)

And of course O'Reilly has an entire series of manuals on X and Xt.
O'Reilly ordering is 800-998-9938. In particular, Volume 5 is an Xt
reference done in manual page style. The 3rd edition is extensively
overhauled and goes far beyond the MIT manual pages. I'm finding it
very useful. In particular, the permutted index and references to
other manual pages help a great deal in chasing down related
information.

I read two periodicals, "The X Resource" and the "The X Journal".
These are the only two dealing specifically with X. "The X Resource"
is published quarterly, by O'Reilly, with one of the issues being the
MIT X Consortium Technical Conference Proceedings. There is no
advertising. I've found it informative with pretty good depth. For
orders, call 1-800-998-9938, or email [email protected] For editorial
matters, email [email protected] Table of contents are posted at
math.utah.edu in ~ftp/pub/tex/bib in TeX form and on ftp.uu.net in
~ftp/published/oreilly/xresource in ASCII form.


"The X Journal" is a bimonthly trade rag with lots of advertising.
The articles are informative and oriented toward a less technical
audience. I read it more to see what's going on then with an
expectation of learning a great deal (but remember, I represent a
fairly small percentage of people). Also, they have a pretty good
collection of people on the advisory board and as columnists. Call
(908) 563-9033.

----------------------------------------------------------------------
14. What Widgets are available?
----------------------------------------------------------------------

There are three popular widget sets:

Athena- The set provided with X11. This is sufficient for most
purposes but is on the ugly side. Recently, a 3d look is
available for ftp on export.lcs.mit.edu:/contrib/Xaw3d.tar.Z.
Motif- From OSF available for a license fee and commonly shipped on
many workstation vendors platforms (almost everyone but
Sun). It looks good and works well but personally I think
it is poorly implemented.
OLIT- The Open Look Intrinsics Toolkit is a set of widgets
implementing Sun's Open Look specification. Developed by
AT&T. I've never used it so can't comment on its quality.
I've heard rumours that it is a pain to actually get.

In addition the following collection of widgets are also available:

Xtra- a library of widgets for sale from Graphical Software
Technology (310-328-9338). It includes bar graph, stacked
bar graph, line graph, pie chart, xy plot, hypertext, help,
spreadsheet, and data entry form widgets. I've never seen
them so I can't comment.
FWF- The Free Widget Foundation is attempting to collect a set of
freely available widgets. Included are a Pixmap editor,
FileDialog, and a few others. The current set of widgets
can be obtained via anonymous ftp from the machine
a.cs.uiuc.edu (128.174.252.1) in the file pub/fwf.shar.Z.
Xcu- The Cornell University widgets from Gene Dykes. One of the
early widget sets released. Provides a nice appearance for
buttons and has a mini command language. Probably not so
widely used.
Xs- The Sony widget set. This was around during R3 days but
seemed to disappear. It looked like it had promise.
Xw- The HP widgets. The precursor to Motif. Originally written
for R3 there exists diffs to get it to work under R4 & R5.
Again, a pretty good widget set but has more or less died.
The precursor to this was the Xray toolkit which was
originally implemented for X10R4 and apparently provided
much experience for the designers of Xt.
Xo- A widget set I'm working on. It's still primitive but you
can give it a try in archive.cis.ohio-state.edu:pub/Xo/*

The following specialized widgets are also available:

Tbl- Implements a tabular layout of widgets. Supports Motif
widgets as children. Part of Wcl.
Plots- The Athena Plotting widgets (not the Athena widgets).
Contact [email protected] or [email protected]

----------------------------------------------------------------------
15. What alternatives to the Intrinsics are there?
----------------------------------------------------------------------

__________________________________________
NameLanguageVendor
__________________________________________
XviewCSun
OIC++ParcPlace
InterviewsC++Stanford
__________________________________________


However much I like C and admire the skill in both designing and
implementing the Intrinsics, hopefully some alternative will develop
in the next 3-5 years that uses an object oriented language. Keep
your eyes open and expect some change about the same time a language
other than C _starts_ gaining acceptance.

----------------------------------------------------------------------
16. How do I pass a float value to XtSetValues?
----------------------------------------------------------------------

First, what is going wrong is the structure for an Arg is (essentially)
typdef struct
{
Stringname;
longvalue;
} Arg;

and the code:
Argarg;

XtSetArg (arg, "name", 3.2)

expands to
Argarg;

arg.name = "name";
arg.value = 3.2;

you can see that with normal C type conversions, the arg.value
gets the integer "3" instead of the floating point value "3.2". When
the value is copied into the widget resource, the bit pattern is
wildly different than that required for a floating point value. So,
how to get around this?

The following macro is from the Athena widgets document and I am now
recomending it over the previous suggestions.

#define XtSetFloatArg(arg, n, d) \
if (sizeof(float) > sizeof(XtArgVal)) { \
XtSetArg(arg, n, &(d)); \
} else { \
XtArgVal *ld = (XtArgVal *)&(d); \
XtSetArg(arg, n, *ld); \
}


----------------------------------------------------------------------
17. How do I write a resource converter?
----------------------------------------------------------------------

Courtesy of Rich Thomson ([email protected]):

The following discussion of resource converters assumes R4 (or R5)
Intrinsics. Resource converters changed between R3 and R4 to allow
for destructors and caching of converted values.

There are several main types of resource converters:

string to data type
data type to string
data type to data type

i) string to data type
Usually a string to data type converter has a fixed set of strings
that will be converted to data type values. This is most often
used to map enumerated names to enumerated values:

NameValue
"True"1
"False"0

In this case, the string to data type converter needs to compare
the resource value to the list of fixed strings. This is most
readily accomplished by the use of the "quark" mechanism of the
resource manager. The resource value is turned into a quark,
which is a unique representation of the string that fits into a
single word. Then the resource quark is compared against the
quarks for the fixed strings representing the enumerated values.

If there are many enumerated strings in the converter (or many
converters, each with a small number of enumeration strings), then
a global initialization routine might be used to turn all the
resource strings into quarks. That way, the first time one of
these converters is used, the strings will be turned into quarks
and held in static variables for use in the next invocation of one
of the converters.

ii) data type to string
This type of converter is slightly easier than the string to data
type converters since the use of quarks isn't necessary. Instead,
the data type value is simply converted to a string value,
probably by the use of sprintf.

Data type to string converters are useful for applications that
wish to convert an internal data type value into a string so that
they can write out a valid resource specification to a file. This
mechanism can be used to provide a "snapshot" of application state
into a file. This snapshot can be used to restore the program to
a known state via the usual X resource database mechanisms.

If you are taking the trouble to write a string to data type
converter, it isn't much extra effort to write the data type to
string converter. Writing both at the same time helps to ensure
that they are consistent.

iii) data type to data type
This type of converter is used to convert an existing data type
value to another data type. For instance, an X pixel value can be
converted to an RGB data type that contains separate fields for
red, green and blue.


The type signature for a resource converter is as follows:

typedef Boolean (*XtTypeConverter)(Display *, XrmValuePtr, Cardinal *,
XrmValuePtr, XrmValuePtr, XtPointer *);
Display *dpy;
XrmValuePtr args;
Cardinal *num_args;
XrmValuePtr fromVal;
XrmValuePtr toVal;
XtPointer *converter_data;

When the converter is invoked, the "fromVal" argument points to the source
X resource manager value and the "toVal" argument points to the
destination X resource manager value. The "converter_data" argument
is an opaque pointer to some converter-specific data that is specified
when the converter is registered. The "args" and "num_args" arguments
allow extra information to be passed to the converter when it is
invoked. For instance, the Pixel to RGB structure converter discussed
above would need colormap and visual arguments in which to lookup the
Pixel to obtain the RGB values corresponding to that pixel.

Care must be taken with the "toVal" argument. An XrmValue has the
following type definition and specifies a size and location for a
converted value:

typedef struct {
unsigned int size;
caddr_t addr;
} XrmValue, *XrmValuePtr;

When the converter is invoked, the address may point to a location of
the given size for the converted value or the location can be NULL.
In the former case, the converter should ensure that the size of the
destination area is large enough to handle the converted value. If
the destination area is not large enough, then the converter should
set the size to the amount of space needed and return False. The
caller can then ensure that enough space is allocated and reinvoke the
converter. If the size is large enough, then the converter can simply
copy the converted value into the space given and return True.

If the location is NULL, then the converter can assign the location to
the address of a static variable containing the converted value and
return True.

When writing a group of converters, this code is often repeated and it
becomes convenient to define a macro:

#define DONE(var, type) \
if (toVal->addr) \
{ \
if (toVal->size < sizeof(type)) \
{ \
toVal->size = sizeof(type); \
return False; \
} \
else \
*((type *) toVal->addr) = var; \
} \
else \
toVal->addr = (caddr_t) &var; \
toVal->size = sizeof(type); \
return True;

#define DONESTR(str) \
if (toVal->addr && toVal->size < sizeof(String)) \
{ \
toVal->size = sizeof(String); \
return False; \
} \
else \
toVal->addr = (caddr_t) str; \
toVal->size = sizeof(String); \
return True;

Inside the converter, it is a good idea to perform a little safety
checking on the "num_args" and "args" arguments to ensure that your
converter is being called properly.

Once you have written your converter, you need to register it with the
Intrinsics. The Intrinsics invokes resource converters when creating
widgets and fetching their resource values from the resource database.

To register a converter with a single application context, use
XtAppSetTypeConverter:

void XtAppSetTypeConverter(context, from, to, converter, args, num_args,
cache, destructor)
XtAppContext context;
String from;
String to;
XtTypeConverter converter;
XtConvertArgList args;
Cardinal num_args;
XtCacheType cache;
XtDestructor destructor;

To register a converter with all application contexts, use
XtSetTypeConverter:

void XtSetTypeConverter(from, to, converter, args, num_args,
cache, destructor)
String from;
String to;
XtTypeConverter converter;
XtConvertArgList args;
Cardinal num_args;
XtCacheType cache;
XtDestructor destructor;

In the R3 Intrinsics, there were the routines XtAppAddConverter and
XtAddConverter; these have been superseded by XtAppSetTypeConverter
and XtSetTypeConverter. Whenever possible, the newer routines should be
used.

When a converter is registered with the Intrinsics, a "cache" argument
specifies how converted resource values are to be cached:

XtCacheNoneDon't cache any converted values
XtCacheAllCache all converted values
XtCacheByDisplayCache converted values on a per display basis

Caching converted values that require a round-trip to the server is a
good idea (for instance string to Pixel conversions).

The "destructor" argument is a routine that is invoked then the
resource is destroyed, either because its cached reference count has
been decremented to zero or because the widget owning the value is
being destroyed. XtDestructor has the following type definition:

typedef void (*XtDestructor)(XtAppContext, XrmValuePtr, XtPointer,
XrmValuePtr, Cardinal *);
XtAppContext context;
XrmValuePtr to;
XtPointer converter_data;
XrmValuePtr args;
Cardinal *num_args;

The destructor is invoked to free any auxiliary storage associated
with the "to" argument, but does not actually free the storage pointed
to by the "to" argument itself (to->addr). The destructor is passed
the extra arguments that were passed to the converter when the
conversion was performed (for instance, colormap and visual arguments
for the string to Pixel converter since the destructor would need to
free the allocated Pixel from the colormap) as well as the private
data passed in when the converter was registered.

Sample converter code can be found in the following files in the MIT
R5 distribution:

mit/lib/Xt/Converters.c
contrib/lib/PEXt/Converters.c
contrib/lib/PEXt/Converters.h

----------------------------------------------------------------------
18. How do I open multiple displays?
----------------------------------------------------------------------

See "Multi-user Application Software Using Xt", The X Resource, Issue 3,
(Summer 1992) by Oliver Jones for a complete coverage of the issues
involved. Most of this answer is based on that article. In a
nutshell, one uses XtOpenDisplay() to add each display to a _single_
application context and then XtCloseDisplay() to shutdown each display
and remove it from the application context.

The real problems occur when trying to close down a display. This can
happen 3 ways:
1. User selects a "quit" button on one of the displays,
2. User has window manager send a WM_DELETE_WINDOW message,
3. Server disconnect -- possibly from a KillClient message,
server shutdown/crash, or network failure.

I'll assume you can deal gracefully with 1 & 2 since it is _merely_ a
problem of translating a Widget to a display and removing that
display. If not, then read the Oliver Jones article.

The third one is difficult to handle. The following is based on the
Oliver Jones article and I include it here because it is a difficult
problem.

The difficulty arises because the Xlib design presumed that an I/O
error is always unrecoverable and so fatal. This is essentially true
for a single display X based application, but not true for a
multiple display program or an application that does things other than
display information on an X server. When an X I/O error occurs the
I/O error handler is called and _if_ it returns then an exit()
happens. The only way around this is to use setjmp/longjmp to avoid
returning to the I/O error handler. The following code fragment
demonstrates this:

#include
jmp_buf XIOrecover;

void
XIOHandler (dpy)
Display*dpy;
{
destroyDisplay (dpy);
longjmp (XIOrecover, 1);
}

main ()
{
...
if (setjmp (XIOrecover) == 0)
XSetIOErrorHandler (XIOHandler);
XtAppMainLoop (app_context);
}

The destroyDisplay() is something that given a Display pointer can go
back to the application specific data and perform any necessary
cleanup. It should also call XtCloseDisplay().

For those of you unfamiliar with setjmp/longjmp, when setjmp() is
first called it returns a 0 and save's enough information in the
jmp_buf that a latter execution of longjmp() can return the program to
the same state as if the setjmp() was just executed. The return value
of this second setjmp() is the value of the second argument to
longjmp(). There are several caveats about using these but for this
purpose it is adequate.

Some other problems you might run into are resource converters that
improperly cache resources. The most likely symptoms are Xlib errors
such as BadColor, BadAtom, or BadFont. There may be problems with the
total number of displays you can open since typically only a limited
number of file descriptors are available with 32 being a typical
value. You may also run into authorization problems when trying to
connect to a display.

There was much discussion in comp.windows.x about this topic in
November of 91. Robert Scheifler posted an article which basically
said this is the way it will be and Xlib will not change.

----------------------------------------------------------------------
19. What changed from R3 to R4 to R5?
----------------------------------------------------------------------

This addresses only changes in the Intrinsics. First, the general
changes for each release are described. Then a, certainly incomplete,
list of new functions added and others that are now deprecated are
listed. Brevity is a primary goal.

Much of the following information is retrieved from Chapter 13 of the MIT
Xt Intrinsics Manual and from O'Reilly Volume 5, 3rd edition.

From R3 to R4
- Addition of gadgets (windowless widgets)
- New resource type converter interface to handle cacheing and
additional data.
- Variable argument list interface.
- #define XtSpecificationRelease 4 (added with this release)
- WMShellPart, TopLevelShellPart & TransientShellPart changed
incompatibly.
- core.initialize, core.set_values added ArgList and count parameters
- event handlers had continue_to_dispatch parameter added
- core.set_values_almost specification changed.
- core.compress_exposure changed to an enumerated data type from Boolean
- core.class_inited changed to enumerated data type from Boolean
- constraint.get_values_hook added to extension record
- core.initialize_hook obsolete as info is passed to core.initialize
- shell.root_geometry_manager added to extension record
- core.set_values_hook obsolete as info is passed to core.set_values
- Calling XtQueryGeometry() must store complete geometry.
- Added UnrealizeCallback.
- XtTranslateCoords() actually works under R4.

From R4 to R5:
- Psuedo resource baseTranslation added.
- Searching for app-default, and other files, made more flexible
- customization resource added.
- Per-screen resource database.
- Support permanently allocated strings.
- Permanetly allocated strings required for several class fields.
- The args argument to XtAppInitialize, XtVaAppInitialize,
XtOpenDisplay, XtDisplayInitialize, and XtInitialize were changed
from Cardinal* to int*
- Many performance improvements (this is summarized from the article
"Xt Performance Improvements in Release 5" by Gabe Beged-Dov in "The
X Resource", Issue 3):
- XrmStringToQuark() augmented with XrmPermStringToQuark() to
avoid string copies. Several fields in the class record are
indicated as needing permanent strings.
- Using an array of Strings for resources
- Callback lists redesigned to use less memory
- Translation manager redesigned and rewritten so it takes
less memory, translation tables merges are faster, cache of
action bindings
- Keycode to Keysyms are cached.
- Better sharing of GC's with modifiable fields
- Window to Widget translation uses less space and faster
- Does not malloc space for widget name since quark is available
- Widget space is allocated to include the constraints
- Over several example programs, about a 26% reduction in
memory usage.

Functions new with R5:
----------------------
XtAllocateGC()- sharable GC with modifiable fields
XtGetActionList()- get the action table of a class
XtScreenDatabase()- return resource database for a screen
XtSetLanguageProc()- register language procedure called to set locale


Functions new with R4:
----------------------
XtAppAddActionHook()- procedure to call before _every_ action.
XtAppInitialize()- lots of initialization work.
XtAppReleaseCacheRefs()- decrement cache reference count for converter
XtAppSetFallbackResources() - specify default resources
XtAppSetTypeConverter()- register a new style converter
XtCallCallbackList()- directly execute a callback list
XtCallConverter()- invoke a new style converter
XtCallbackReleaseCacheRef() - release a cached resource value
XtCallbackReleaseCacheRefList() - release a list of cached resource values
XtConvertAndStore()- find and call a resource converter
XtDirectConvert()- Invoke old-style converter
XtDisplayOfObject()- Return the display
XtDisplayStringConversionWarning() - issue a warning about conversion
XtFindFile()- Find a file
XtGetActionKeysym()- Retrieve keysym & modifies for this action
XtGetApplicationNameAndClass() - return name and class
XtGetConstraintResourceList() - get constraints for a widget
XtGetKeysymTable()- return keycode-to-keysym mapping table
XtGetMultiClickTime()- read the multi-click time
XtGetSelectionRequest()- retrieve the SelectionRequest event
XtGetSelectionValueIncremental() - obtain the selection value incrementally
XtGetSelectionValuesIncremental() - obtain the selection value incrementally
XtInitializeWidgetClass() - initialize a widget class manually
XtInsertEventHanlder()- register event handler before/after others
XtInsertRawEventHandler() - register event handler without modify input mask
XtIsObject()- test if subclass of Object
XtIsRectObj()- test if subclass of RectObj
XtKeysymToKeyCodeList()- return list of keycodes
XtLastTimestampProcessed() - retrieve most recent event time
XtMenuPopdown- Action for popping down a widget
XtMenuPopup- Action for popping up a widget
XtOffsetOf- macro for structure offsets
XtOwnSelectionIncremental() - make selection data availabe incrementally
XtPoupSpringLoaded()- map a spring-loaded popup
XtRegisterGrabAction()- indicate action procedure needs a passive grab
XtRemoveActiohHook()- remove function called after every action
XtResolvePathname()- find a file
XtScreenOfObject()- return screen of object.
XtSetMultiClickTime()- set the multi-click time
XtSetWMColormapWindows() - set WM_COLORMAP_WINDOWS for custom colormaps
XtUngrabButton()- cancel a passive button grab
XtUngrabKey()- cancel a passive key grab
XtUngrabKeybard()- release an active keyboard grab
XtUngrabPointer()- release an active pointer grab
XtVa*()- varags interfaces to a bunch of functions
XtWindowOfObject()- return Window of nearest widget ancestor


DeprecatedReplacementWhen
----------------------------------------------------------------------
XtAddActions()XtAppAddActions()R3
XtAddConverter()XtAppAddConverter()R3
XtAddInput()XtAppAddInput ()R3
XtAddTimeout()XtAppAddTimeout()R3
XtAddWorkProc()XtAppAddWorkProc()R3
XtConvert()XtConvertAndStore()R4
XtCreateApplicationShell XtAppCreateShell()R3
XtDestroyGC()XtReleaseGC()R3
XtError()XtAppError()R3
XtGetErrorDatabase()XtAppGetErrorDatabaseR3
XtGetErrorDatabaseText() XtAppGetErrorDatabaseTextR3
XtGetSelectionTimeout()XtAppGetSelectionTimeoutR3
XtInitialize()XtAppInitialize()R3
XtMainLoop()XtAppMainLoop()R3
MenuPopdown(action)XtMenuPopdown(action)R4
MenuPopup(action)XtMenuPopup(action)R4
XtNextEvent()XtAppNextEvent()R3
XtPeekEvent()XtAppPeekEvent()R3
XtPending()XtAppPending()R3
XtSetErrorHandler()XtAppSetErrorHandler()R3
XtSetErrorMsgHandlerXtAppSetErrorMsgHandler()R3
XtSetSelectionTimeout()XtAppSetSelectionTimeout()R3
XtSetWarningHandler()XtAppSetWarningHandler()R3
XtSetWarningMsgHandler() XtAppSetWarningMsgHandler()R3
XtWarning()XtAppWarning()R3
XtWarningMsg()XtAppWarningMsg()R3

----------------------------------------------------------------------
20. Where are the resources loaded from?
----------------------------------------------------------------------

The resources of a widget are filled in from the following places
(from highest priority to lowest priority):

1. Args passed at creation time.
2. Command line arguments.
3. User's per host defaults file
4. User's defaults file.
5. User's per application default file.
6. System wide per application default file.

Note that 2-6 are read only once on application startup. The result
of steps 3-6 is a single resource database used for further queries.

The per host defaults file contains customizations for all
applications executing on a specific computer. This file is either
specified with the XENVIRONMENT environment variable or if that is not
set then the file $HOME/.Xdefaults- is used.

The user defaults file is either obtained from the RESOURCE_MANAGER
property on the root window of the display or if that is not set then
the file $HOME/.Xdefaults is used. Typically, the program "xrdb" is
used to set the RESOURCE_MANAGER property. Please note that this
should be kept relatively small as each client that connects to the
display must transfer the property. A size of around 1-3KByte is
reasonable. Some toolkits may track changes to the RESOURCE_MANAGER
but most do not.

A user may have many per application default files containing
customizations specific to each application. The intrinsics are quite
flexible on how this file is found. Read the next part that describes
the various environment variables and how they effect where this file
is found.

The system wide per application default files are typically found in
/usr/lib/X11/app-defaults. If such a file is not found then the
fallback resources are used. The intrinsics are quite flexible on how
this file is found. Read the next part that describes the various
environment variables and how they effect where this file is found.

[Thanks to Oliver Jones ([email protected]) for the following, 6/92]

You can use several environment variables to control how resources are
loaded for your Xt-based programs -- XFILESEARCHPATH,
XUSERFILESEARCHPATH, and XAPPLRESDIR. These environment variables
control where Xt looks for application-defaults files as an
application is initializing. Xt loads at most one app-defaults file
from the path defined in XFILESEARCHPATH and another from the path
defined in XUSERFILESEARCHPATH.

Set XFILESEARCHPATH if software is installed on your system in such a
way that app-defaults files appear in several different directory
hierarchies. Suppose, for example, that you are running Sun's Open
Windows, and you also have some R4 X applications installed in
/usr/lib/X11/app-defaults. You could set a value like this for
XFILESEARCHPATH, and it would cause Xt to look up app-defaults files
in both /usr/lib/X11 and /usr/openwin/lib (or wherever your
OPENWINHOME is located):

setenv XFILESEARCHPATH /usr/lib/X11/%T/%N:$OPENWINHOME/lib/%T/%N

The value of this environment variable is a colon-separated list of
pathnames. The pathnames contain replacement characters as follows
(see XtResolvePathname()):

%NThe value of the filename parameter, or the
application's class name.
%TThe value of the file "type". In this case, the
literal string "app-defaults"
%Ccustomization resource (R5 only)
%SSuffix. None for app-defaults.
%LLanguage, locale, and codeset (e.g. "ja_JP.EUC")
%lLanguage part of %L (e.g. "ja")
%tThe territory part of the display's language string
%cThe codeset part of the display's language string

Let's take apart the example. Suppose the application's class name is
"Myterm". Also, suppose Open Windows is installed in /usr/openwin.
(Notice the example omits locale-specific lookup.)

/usr/lib/X11/%T/%N means /usr/lib/X11/app-defaults/Myterm
$OPENWINHOME/lib/%T/%N means /usr/openwin/lib/app-defaults/Myterm

As the application initializes, Xt tries to open both of the above
app-defaults files, in the order shown. As soon as it finds one, it
reads it and uses it, and stops looking for others. The effect of
this path is to search first in /usr/lib/X11, then in /usr/openwin.

Let's consider another example. This time, let's set
XUSERFILESEARCHPATH so it looks for the file Myterm.ad in the current
working directory, then for Myterm in the directory ~/app-defaults.

setenv XUSERFILESEARCHPATH ./%N.ad:$HOME/app-defaults/%N

The first path in the list expands to ./Myterm.ad. The second expands
to $HOME/app-defaults/Myterm. This is a convenient setting for
debugging because it follows the Imake convention of naming the
app-defaults file Myterm.ad in the application's source directory, so
you can run the application from the directory in which you are
working and still have the resources loaded properly.

NOTE: when looking for app-default files with XUSERFILESEARCHPATH,
for some bizarre reason, neither the type nor file suffix is
defined so %T and %S are useless.

With R5, there's another twist. You may specify a customization
resource value. For example, you might run the "myterm" application
like this:

myterm -xrm "*customization: -color"

If one of your pathname specifications had the value
"/usr/lib/X11/app-defaults/%N%C" then the expanded pathname would be
"/usr/lib/X11/app-defaults/Myterm-color" because the %C substitution
character takes on the value of the customization resource.

The default XFILESEARCHPATH, compiled into Xt, is:

/usr/lib/X11/%L/%T/%N%C:\ (R5)
/usr/lib/X11/%l/%T/%N%C:\ (R5)
/usr/lib/X11/%T/%N%C:\ (R5)
/usr/lib/X11/%L/%T/%N:\
/usr/lib/X11/%l/%T/%N:\
/usr/lib/X11/%T/%N

(Note: some sites replace /usr/lib/X11 with a ProjectRoot in this
batch of default settings.)

The default XUSERFILESEARCHPATH, also compiled into Xt, is

/%L/%N%C:\ (R5)
/%l/%N%C:\ (R5)
/%N%C:\ (R5)
/%L/%N:\
/%l/%N:\
/%N:

is either the value of XAPPLRESDIR or the user's home directory
if XAPPLRESDIR is not set. If you set XUSERFILESEARCHPATH to some
value other than the default, Xt ignores XAPPLRESDIR altogether.

Notice that the quick and dirty way of making your application find
your app-defaults file in your current working directory is to set
XAPPLRESDIR to ".", a single dot. In R3, all this machinery worked
differently; for R3 compatibilty, many people set their XAPPLRESDIR
value to "./", a dot followed by a slash.


----------------------------------------------------------------------
21. What order are callbacks executed in?
----------------------------------------------------------------------
(Courtesy of Donna Converse, [email protected]; 5/10/92)

The Intrinsics library do not guarantee an order. This is because
both the widget writer and the application writer have the ability to
modify the entire contents of the callback list. Neither one
currently knows what the other is doing and so the Intrinsics cannot
guarantee the order of execution.

The application programmer cannot rely on the widget writer; the
widget writer is not required to document when the widget will add and
remove callbacks from the list or what effect this will have;
therefore the functionality contained in a callback should be
independent of the functionality contained in other callbacks on the
list.

Even though the Xt standard in the definition of XtAddCallback
says:

"callback_name: Specifies the callback list to which the
procedure is to be appended."

you may not infer from the word "appended" that the callback routines
are called in the same order as they have been added to the callback
list.

----------------------------------------------------------------------
22. How do I know if a widget is visible?
----------------------------------------------------------------------
(Courtesy of Donna Converse, [email protected]; 5/14/92)

> I am building a widget needs to know if it is visible. I set the visible
> interest field in Core and if my window is completely obscured, the Core
> visible flag goes FALSE. However, if my window is iconified, the flag
> stays set to TRUE.

Right, everything is implemented correctly. This demonstrates a "deficiency"
in the X protocol, and the Core widget is reflecting the capabilities of the
protocol. (The "deficiency" is that the information is available in one way,
in this case an inconvenient way.) The Xt specification is accurate, in
the second and third paragraphs of section 7.10.2, so read this section
carefully. The visible field will not change in response to iconification.

A VisibilityNotify event will not be received when the window goes from
viewable to unviewable, that is, when the widget or an ancestor is unmapped;
that is, when iconification occurs. This is the protocol deficiency.
Visibility state and viewable state have specific meanings in the X protocol;
see the glossary in your Xlib and X protocol reference manual.

> Is this a problem with "mwm" or is there something
> else which needs to be done?

You'll see this with any window manager, with no window manager.

> If the problem is "mwm", what is the fastest
> way to determine if a window is iconified?

As an application writer, keep track with a global Boolean in an action
routine with translations for MapNotify and UnmapNotify on the Shell widget
which contains your custom widget. As the custom widget writer, see the
map_state field returned by a call to XGetWindowAttributes. These are
suggestions.

----------------------------------------------------------------------
23. How do I reparent a widget in Xt, i.e. XtReparentWidget()?
----------------------------------------------------------------------

You can't.

----------------------------------------------------------------------
24. Why use XtMalloc, XtFree, etc?
----------------------------------------------------------------------

Unfortunately, most code that calls malloc(), realloc() or calloc()
tends to ignore the possibility of returning NULL. At best it is
handled something like:

ptr = (type *) malloc (sizeof (type))
if (!ptr)
{
perror ("malloc in xyzzy()");
exit (1)
}
To handle this common case the Intrinsics define the functions
XtMalloc(), XtCalloc(), XtNew(), XtNewString() and XtRealloc() which
all use the standard C language functions malloc(), calloc() and
realloc() but execute XtErrorMsg() if a NULL value is returned. Xt
error handlers are not supposed to return so this effectively exits.

In addition, if XtRealloc() is called with a NULL pointer, it uses
XtMalloc() to get the initial space. This allows code like:

if (!ptr)
ptr = (type *) malloc (sizeof (type));
else
ptr = (type *) realloc (ptr, sizeof (type) * (count + 1));
++count;

to be written as:

ptr = XtRealloc (ptr, sizeof (ptr) * ++count);

Also, XtFree() accepts a NULL pointer as an argument. Generally, I've
found the Xt functions conveniant to use. However, anytime I'm
allocating anything potentially large I use the standard functions so
I can fully recover from not enough memory errors.

XtNew() and XtNewString() are conveniant macros for allocating a
structure or copying a string:

struct abc *xyzzy;
char *ptr;
char *str = "abcdef";

xyzzy = XtNew (struct abc);/* takes care of type casting */
ptr = XtNewString (str);

Just to emphasize this, the Xt memory allocators are required to be
compatible and so interchangeable with the standard C library memory
allocators.

A common error for Motif programmers is to use XtFree() on a string
when they should really be using XmStringFree().

----------------------------------------------------------------------
25. How to debug an Xt application?
----------------------------------------------------------------------
First, I'd recomend getting "purify" from Pure Software. This is a
great package for tracing memory problems on Sun's. It's a bit pricey
at $2750 but I'd still recomend it. Excuse the marketing blurb
(contact [email protected] for more info).

Purify inserts additional checking instructions directly into
the object code produced by existing compilers. These
instructions check every memory read and write performed by
the program under test and detect several types of access
errors, such as reading unitialized memory, writing past
malloc'd bounds, or writing to freed memory. Purify inserts
checking logic into all of the code in a program, including
third party and vendor object-code libraries, and verifies
system call interfaces. In addition, Purify tracks memory
usage and identifies individual memory leaks using a novel
adaption of garbage collection techniques. Purify's nearly
comprehensive memory access checking slows the target program
down typically by a factor of two to five.

An alternative package that isn't as pricey ($395 for a Sun), runs on
many Unix's and has pretty similar features is "The SENTINEL Debugging
Environment". This replaces malloc() and several other C library
functions to add additional checks. (contact [email protected]
for more info)

Next, if you are getting any sort of Xlib error, you'll need to run in
synchronous mode, easily accomplished with the "-sync" command line
argument or by setting the variable Xdebug to 1 with your debugger. Then
set a break point in exit(). This will let you trace back to the
original Xlib function being called. If you don't run in synchronous
mode, then the actual error may have occured any number of calls to
Xlib previously since the Xlib calls are buffered and replies from the
server are asynchronous.

Next, if you are having trouble with window layout, you can use the
undocumented resource "xtIdentifyWindows" or the class resource
"XtDebug" to cause the widget name to be identified with each window.
For example:

example% xload -xrm '*XtDebug:true' &
example% xwininfo -tree


will give the normal information but the widget name and class of each
window is included. This can help for checking the location and size
of errant widgets.

Next, if you are having trouble with geometry managers or you want to
test the way a widget manages it's children, you can try
export.lcs.mit.edu:contrib/libXtGeo.tar.Z. This acts as a filter
between any children and a geometry manager and checks the behaviour
of both. It's a very clever idea.

The most unfortunate problem is debugging a callback while the
application is executing a grab of the keyboard or mouse (such as from
a pulldown menu). The server effectively locks up and you'll need to
go to another machine and kill the debugger manually. The server
locks up because the application being debugged has said no one else
can have access to the keyboard but the application is not stopped
waiting because the debugger is waiting for your commands.
Unfortunately you can't give them because all the input is going to
your application which is stopped.

The best way to debug this kind of problem is with two machines on
your desk, running the program under a debugger (or other environment)
on one machine, and running the application on the other, possibly
using a command sequence like this:

othermachine% xhost +thismachine
thismachine% setenv DISPLAY othermachine:0;
thismachine% gdb application# Your favorite debugger.
or this:
othermachine% xhost +thismachine
thismachine% gdb application
(gdb) set environment DISPLAY othermachine:0
(gdb) run ...

I believe CodeCenter, a C interpreter/graphical debugger has a method
of dealing with this by explicitely calling the Xlib functions to
release any grabs during breakpoints.

Debugging widget problems requires pretty good debugging skills and
knowledge of how widgets work. You can go a long way without knowing
the internals of a particular widget but not very far without
understanding how a widget works. Judicious use of conditional
breakpoints and adding print statements with the debugger help a great
deal.

----------------------------------------------------------------------
26. Why don't XtAddInput(), XtAddTimeout() and XtAddWorkProc() work?
----------------------------------------------------------------------
I have got a delicate problem with the three routines XtAddInput,
XtAddTimeOut and XtAddWorkProc. The problem I have is that when
I use them in my application they seem not to be registred properly.
I have made a handy little testprogram where everything works
perfect, but in my "real" application nothing happens.

The introduction in R3 of the XtApp*() functions obsoleted those
routines (see Q19 for other changes in R3, R4, and R5). What happens is
they use a default application context different then the one you may
have created. Since events and timeouts are distributed on a per
application context basis and you are using two application contexts,
you won't get those events.

For example:

...
cnt = 0;
toplevel = XtAppInitialize(&app, class,
Desc, XtNumber (Desc),
&argc, argv,
Fallback, args, cnt);

XtAddTimeOut (...)
XtAddWorkProc (...)

XtAppMainLoop (app)

would never invoke the timeout.

--
Pete [email protected]
CIS Dept, Ohio State Universityw/ (614) 292-7318
228 Bolz Hall, 2036 Neil Ave.h/ (614) 538-0965
Columbus, OH 43210

From: [email protected] (David B. Lewis)
Subject: comp.windows.x Frequently Asked Questions (FAQ) 1/5
Summary: useful information about the X Window System
Date: 8 Feb 93 14:35:59 GMT
Reply-To: faq%[email protected] (X FAQ maintenance address)

Archive-name: x-faq/part1
Last-modified: 1993/02/06


This article and several following contain the answers to some Frequently Asked
Questions (FAQ) often seen in comp.windows.x. It is posted to help reduce
volume in this newsgroup and to provide hard-to-find information of general
interest.

Please redistribute this article!

This article includes answers to the following questions, which are loosely
grouped into categories. Questions marked with a + indicate questions new to
this issue; those with significant changes of content since the last issue are
marked by !:

0) TOPIC: BASIC INFORMATION SOURCES AND DEFINITIONS
1)! What books and articles on X are good for beginners?
2)! What courses on X and various X toolkits are available?
3)! What conferences on X are coming up?
4) What X-related public mailing lists are available?
5) How can I meet other X developers?
6) What related FAQs are available?
7) How do I ask a net-question so as to maximize helpful responses?
8) What publications discussing X are available?
9) What are these common abbreviations/acronyms?
10) What is the ICCCM? (How do I write X-friendly applications?)
11) What is the X Consortium, and how do I join?
12) Just what are OPEN LOOK and Motif?
13) Just what is OpenWindows?
14) Just what is DECWindows?
15) What is PEX?
16)! What is "low-bandwidth X" (LBX)? XRemote? PPP? SLIP? CSLIP?
17) TOPIC: USING X IN DAY-TO-DAY LIFE
18)! What are all these different window managers?
19) Why does my X session exit when I kill my window manager (sic)?
20) Can I save the state of my X session, like toolplaces does?
21) How do I use another window manager with DEC's session manager?
22) How do I change the keyboard auto-repeat rate?
23) How do I remap the keys on my keyboard to produce a string?
24) How do I make a screendump or print my application?
25) How do I make a color PostScript screendump of the X display?
26) How do I make a screendump including the X cursor?
27) How do I convert/view Mac/TIFF/GIF/Sun/PICT/img/FAX images in X?
28) How can I change the titlebar of my xterm window?
29) Where can I find the xterm control sequences?
30) Why does the R3 xterm, et al, fail against the R4 server?
31) How can I use characters above ASCII 127 in xterm ?
32) Why are my xterm menus so small?
33) How can I print the current selection?
34)! How does Xt use environment variables in loading resources?
35) How to I have the R4 xdm put a picture behind the log-in window?
36) Why isn't my PATH set when xdm runs my .xsession file?
37) How do I keep my $DISPLAY when I rlogin to another machine?
38) How can I design my own font?
39) Why does adding a font to the server not work (sic)?
40) How do I convert a ".snf" font back to ".bdf" font?
41) What is a general method of getting a font in usable format?
42) How do I use DECwindows fonts on my non-DECwindows server?
43) How do I add ".bdf" fonts to my DECwindows server?
44) How can I set the backgroundPixmap resource in a defaults file?
45) Why can't I override translations? Only the first item works.
46) How can I have xclock or oclock show different timezones?
47) I have xmh, but it doesn't work. Where can I get MH?
48) Why am I suddenly unable to connect to my Sun X server?
49) Why don't the R5 PEX demos work on my mono screen?
50) How do I get my Sun Type-[45] keyboard fully supported by Xsun?
51) How do I report bugs in X?
52) Why do I get "Warning: Widget class version mismatch"?
53) Where can I find a dictionary server for xwebster?
54) TOPIC: OBTAINING X AND RELATED SOFTWARE AND HARDWARE
55) Is X public-domain software?
56) How compatible are X11R3, R4, and R5? What changes are there?
57) Where can I get X11R5 (source and/or binaries)?
58)! Where can I get patches to X11R5?
59) What is the xstuff mail-archive?
60) Where can I get X11R4 (source and binaries)?
61)! Where can I get OSF/Motif?
62) Does Motif work with X11R4? X11R5?
63) Where can I get toolkits implementing OPEN LOOK?
64)! Where can I get other X sources? (including R5 modifications)
65)! Where can I get interesting widgets?
66) Where can I get a good file-selector widget?
67) What widget is appropriate to use as a drawing canvas?
68) What is the current state of the world in X terminals?
69) Where can I get an X server with a touchscreen or lightpen?
70) Where can I get an X server on a PC (DOS or Unix)?
71) Where can I get an X server on a Macintosh running MacOS?
72) Where can I get X for the Amiga?
73) Where can I get a fast X server for a workstation?
74) Where can I get a server for my high-end Sun graphics board?
75) Where can I get an "X terminal" server for my low-end Sun 3/50?
76)! What terminal emulators other than xterm are available?
77)! Where can I get an X-based editor or word-processor?
78) Where can I get an X-based mailer?
79)! Where can I get an X-based paint/draw program?
80) Where can I get an X-based plotting program?
81)! Where can I get an X-based spreadsheet?
82) Where can I get X-based project-management software?
83) Where can I get an X-based PostScript previewer?
84) Where can I get an X-based GKS package?
85)! Where can I get an X-based PEX package?
86) Where can I get an X-based TeX or DVI previewer?
87) Where can I get an X-based troff previewer?
88)! Where can I get a WYSIWYG interface builder?
89) Where can I find X tools callable from shell scripts?
90)! Where can I get an X-based debugger?
91) How can I "tee" an X program identically to several displays?
92) TOPIC: BUILDING THE X DISTRIBUTION [topic needs updating to R5]
93) What's a good source of information on configuring the X build?
94) Why doesn't my Sun with a cg6 work with R5?
95) Why doesn't my Sun with SunOS 4.1 know about _dlsym, etc.?
96) What is this strange problem building X clients on SunOS 4.1.2?
97) Why can't gcc compile X11R4 on my SPARC?
98) What are these I/O errors running X built with gcc?
99) What are these problems compiling X11R4 on the older Sun3?
100) What are these problems compiling the X server on SunOS 4.1.1?
101) What are these problems using R4 shared libraries on SunOS 4?
102) Can OLIT programs run with R5 Xt? (_XtQString undefined)
103) How do I get around the SunOS 4.1 security hole?
104)+ How do I get around the frame-buffer security hole?
105) TOPIC: BUILDING X PROGRAMS
106)! What is Imake?
107) Where can I get imake?
108) I have a program with an Imakefile but no Makefile. What to do?
109) Why can't I link to the Xlib shape routines?
110) What are these problems with "_XtInherit not found" on the Sun?
111) Why can't I compile my R3 Xaw contrib programs under the new X?
112) TOPIC: PROGRAMMING PROBLEMS AND PUZZLES
113) Why doesn't my program get the keystrokes I select for (sic)?
114) How do I figure out what window manager is running?
115) Is there a skeleton X program available?
116) Why does XtGetValues not work for me (sic)?
117) Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
118) Why isn't there an XtReparentWidget call like XReparentWindow?
119) I'm writing a widget and can't use a float as a resource value.
120) Is this a memory leak in the X11R4 XtDestroyWidget()?!
121) Are callbacks guaranteed to be called in the order registered?
122) Why doesn't XtDestroyWidget() actually destroy the widget?
123) How do I query the user synchronously using Xt?
124) How do I determine the name of an existing widget?
125) Why do I get a BadDrawable error drawing to XtWindow(widget)?
126) Why do I get a BadMatch error when calling XGetImage?
127) How can my application tell if it is being run under X?
128) How do I make a "busy cursor" while my application is computing?
129) How do I fork without hanging my parent X program?
130) Can I make Xt or Xlib calls from a signal handler?
131) What are these "Xlib sequence lost" errors?
132) How can my Xt program handle socket, pipe, or file input?
133) How do I simulate a button press/release event for a widget?
134) Why doesn't anything appear when I run this simple program?
135) What is the difference between a Screen and a screen?
136) Can I use C++ with X11? Motif? XView?
137) Where can I obtain alternate language bindings to X?
138) Can XGetWindowAttributes get a window's background pixel/pixmap?
139) How do I create a transparent window?
140) Why doesn't GXxor produce mathematically-correct color values?
141) Why does every color I allocate show up as black?
142) Why can't my program get a standard colormap?
143) Why does the pixmap I copy to the screen show up as garbage?
144) How do I check whether a window ID is valid?
145) Can I have two applications draw to the same window?
146) Why can't my program work with tvtwm or swm?
147) How do I keep a window from being resized by the user?
148) How do I keep a window in the foreground at all times?
149) How do I make text and bitmaps blink in X?
150)! How do I render rotated text?
151) What is the X Registry? (How do I reserve names?)

If you have suggestions or corrections for any of these answers or any
additional information, please send them directly to uunet!craft!faq;
the information will be included in the next revision (or possibly the one
after that; thanks for the many suggestions which haven't been incorporated
yet).

This version of the FAQ is in the process of having R3 information replaced
by R5 information.

This posting is intended to be distributed at approximately the beginning of
each month. New versions are archived on export.lcs.mit.edu and are also
available from [email protected] and [email protected]
(send "help").

The information contained herein has been gathered from a variety of sources.
In many cases attribution has been lost; if you would like to claim
responsibility for a particular item, please let me know.

Conventions used below: telephone numbers tend to be Bell-system unless
otherwise noted; prices on items are not included; email addresses are those
that work from the US.

X Window System is a trademark of the Massachusetts Institute of Technology.
Other trademarks are the property of their respective owners.

(Note: a script by George Ferguson ([email protected]) to pretty-print
this faq is available from ugle.unit.no:/pub/X11/contrib/xfaq2texinfo.)


----------------------------------------------------------------------
~Subject: 0) TOPIC: BASIC INFORMATION SOURCES AND DEFINITIONS
----------------------------------------------------------------------
~Subject: 1)! What books and articles on X are good for beginners?

Ken Lee of the DEC Western Software Laboratory ([email protected])
regularly posts to comp.windows.x and ba.windows.x a bibliography containing
cites of all known reference books and how-to manuals and also cites of
selected technical articles on X and X programming; it is ftp-able as
export.lcs.mit.edu:/contrib/Xbibliography and
gatekeeper.dec.com:/pub/X11/contrib/Xbibliography

Here is an unordered set of the reference books and tutorials most useful for
beginners; most appear on that list [comments are gathered from a variety of
places and are unattributable]:

Asente, Paul J., and Swick, Ralph R., "X Window System Toolkit, The Complete
Programmer's Guide and Specification", Digital Press, 1990. The bible on Xt. A
treasury of information, excellent and invaluable. Distributed by Digital
Press, ISBN 1-55558-051-3, order number EY-E757E-DP; and by Prentice-Hall,
ISBN 0-13-972191-6. Also available through DEC Direct at 1-800-DIGITAL.
[The examples are on export.lcs.mit.edu in contrib/ and on gatekeeper.dec.com
(16.1.0.2) in pub/X11/contrib as asente-swick.examples.tar.Z. They were also
posted to comp.sources.x as xt-examples/part0[1-5].]

Jones, Oliver, Introduction to the X Window System, Prentice-Hall, 1988, 1989.
ISBN 0-13-499997-5. An excellent introduction to programming with Xlib.
Written with the programmer in mind, this book includes many practical tips
that are not found anywhere else. This book is not as broad as the O'Reilly
Xlib tutorial, but Jones is an experienced X programmer and this shows in the
quality and depth of the material in the book. Originally written for X11R1,
recent printings have included corrections and additions and current material.

Young, Doug. "The X Window System: Applications and Programming with Xt (Motif
Version)," Prentice Hall, 1989 (ISBN 0-13-497074-8). The excellent tutorial
"X Window System Programming and Applications with Xt," (ISBN 0-13-972167-3)
updated for Motif. [The examples are available on export; the ones from the
Motif version are in ~ftp/contrib/young.motif.tar.Z.]

Young, Doug and John Pew, "The X Window System: Programming and Applications
with Xt, OPEN LOOK Edition" (ISBN 0-13-982992-X). The tutorial rewritten for
OLIT, with new examples and drag/drop information. [Examples are on export in
youg.olit.tar.Z.]

Heller, Dan. "Motif Programmers Manual". The 6th Volume in the O'Reilly series
covers Motif application programming; it's full of good examples. With Motif
reference pages. (ISBN 0-9937175-70-6.) [The examples are available on uunet
in comp.sources.x and nutshell archives.]

Scheifler, Robert, and James Gettys, with Jim Flowers and David Rosenthal, "X
Window System: The Complete Reference to Xlib, X Protocol, ICCCM, XLFD, X
Version 11, Release 5, Third Edition," Digital Press, 1992. "The Bible" in its
latest revision, an enhanced version of X documentation by the authors of the
Xlib documentation. This is the most complete published description of the X
programming interface and X protocol. It is the primary reference work and is
not introductory tutorial documentation; additional tutorial works will usually
be needed by most new X programmers. Digital Press order EY-J802E-DP, ISBN
0-13-971201-1.

Nye, Adrian, "Xlib Programming Manual, Volume 1" and "Xlib Reference Manual,
Volume 2," O'Reilly and Associates, 1988. A superset of the MIT X
documentation; the first volume is a tutorial with broad coverage of Xlib, and
the second contains reference pages for Xlib functions and many useful
reference appendices. ISBN 0-937175-26-9 (volume 1) and ISBN 0-937175-27-7
(volume 2). [A version updated for X11R4 is available (4/90).]

Nye, Adrian, and Tim O'Reilly, "X Toolkit Programming Manual, Volume 4,"
O'Reilly and Associates, 1989. The folks at O'Reilly give their comprehensive
treatment to programming with the MIT Intrinsics; R4 versions are now
available, as is a Motif 1.1 version (Volume 4M).

O'Reilly, Tim, ed., "X Toolkit Reference Manual, Volume 5," O'Reilly and
Associates, 1989. A professional reference manual for the MIT X11R3 Xt; some
information on X11R4 is included.

Mansfield, Niall. "The X Window System: A User's Guide," Addison-Wesley, 1989.
A tutorial introduction to using X, now upgraded for R4. ISBN 0-201-51341-2.

Quercia, Valerie and Tim O'Reilly. "X Window System User's Guide," O'Reilly and
Associates, 1989. A tutorial introduction to using X. ISBN 0-937175-36-6.
Also available in R4 and Motif flavors.

Mui, Linda and Eric Pearce. "X Window System Administrator's Guide for X11 R4
and R5" [ORA Volume 8]. Help for X users and administrators.
ISBN 0-937175-83-8.

(Prentice-Hall ordering is 201-767-5937. O'Reilly ordering is 800-998-9938.)

In addition, check the X11R4 and X11R5 core distribution in doc/tutorials for
some useful papers and tutorials, particularly the file answers.txt. "Late
Night's Top Ten X11 Questions" by Dave Lemke ([email protected]) and Stuart Marks
([email protected]) answers other common questions and some of these here in more
detail.

New R5 versions of the O'Reilly references (not yet Volume 6) are now available
[8/92]. A single volume, "Programmer's Supplement for R5" by David Flanagan,
provides an overview of new R5 features; it includes man pages for Xlib, Xt,
and Xmu. [ISBN 0-937175-86-2]

----------------------------------------------------------------------
~Subject: 2)! What courses on X and various X toolkits are available?

Advanced Computing Environments periodically offers at least a two-day
Introduction course. Contact Susie Karlson at 415-941-3399 for information.

AT&T offers training in Xlib and in the Xol set. Contact AT&T Corporate
Education & Training for more info; 1-800-TRAINER in the USA.

Communica Software Consultants offers three-day hands-on courses in X
designed for the X Window System developer and programmer. Contact Chris
Clarkson, telephone 61 8 3732523, e-mail [email protected] [12/92]

Cora Computer Technologies (516-485-7343) offers several courses.

GHCT offers a one week lecture/lab course for programmmers designed by
Douglas Young based on his book "The X Window System: Programming and Applica-
tions with Xt, OSF/Motif Edition". Information: Brian Stell (415-966-8805 or
[email protected]).

GHG offers a range of courses on X and Motif. Information: 713-488-8806
or [email protected]

Hands On Learning has live training and self-paced video workshops on
topics such as using and/or programming X, Xlib, Xm, Xt, and widget-writing.
Information: 617-272-0088, 800-248-9133.

Hewlett-Packard (1-800-HPCLASS; or contact your local HP center) offers
a 2-day "Introduction to X", a 5-day Xlib course, a 1-day Xt and Motif 1.1
seminar, and a 5-day Motif lab course.

Integrated Computer Solutions, Inc., offers several multi-day, hands-on
courses on X, Xt, and the Xaw and Motif widget sets, in particular. Information
is available at 617-621-0060 and [email protected]

Intelligent Visual Computing teaches several lab courses on-site for
Motif and XView. IVC is at 1-800-776-2810 or +1 919-481-1353 or at
[email protected]

Iris Computing Laboratories offers five-day Xlib and Xt courses.
Info: +1-505-988-2670 or [email protected]

IXI Limited (+44 223 462 131) offers regular X training courses for
both programmers and non-technical managers. See also: Unipalm, below.

Learning Tree International offers a four-day course in X Window System
applications development, including Xlib and some information on Motif. For
more info call 800-824-9155 (213-417-3484); 613-748-7741 in Canada. Courses are
offered in major North American cities; also in London, Stockholm, Tokyo, and
elsewhere.

Lurnix offers 4-day "type-along courses" on Xt; the course is being
ported from Xaw to Xm. Information is available at 800-433-9337 (in CA: -9338).

Mitch Trachtenberg and Associates offers regular 5-day lab courses on
programming with OSF/Motif, usually in but not limited to Cambridge, MA.
Info: +1 617-225-0440, [email protected]

Non Standard Logics (+33 (1) 43 36 77 50; [email protected]) offers
courses on programming with Xlib, Motif, and creating Motif widgets.

OSF Educational Services (617-621-8778) offers one-day seminars and
one-week Motif lab courses.

John A. Pew offers a 5-day course on OLIT, possibly based on his book
on that subject; 408-224-5739.

SCO (+44 923 816344, [email protected]) offers training for its Open
Desktop (Motif) environment in the UK and Europe.

Software Pundits (617-270-0639) offers a range of courses.

Technology Exchange (617-944-3700) offers a 4-day Xlib/Xt/Motif course.

TeleSoft is now offering a 1-day plus 3-day seminar on X and Motif.
Information: Bruce Sherman (619-457-2700, [email protected]).

Unipalm XTech offers OSF's 5-day Motif course and a 1-day overview on
X. Information: Unipalm Training at +44 952 211797, [email protected]

The University of Edinburgh is developing a series of courses on X and
related topics primarily for non-profit-making training in academia but also
for commercial use. Information: Cliff Booth, Unipalm Ltd, phone +44 223
420002, fax +44 223 426868.

Various other vendors are also beginning to offer X training, usually
specific to a proprietary toolkit or to Xt and a proprietary widget set: DEC
is offering Xlib courses; Sun offers an XView course.

Various universities are offering short X courses or overviews: UCLA,
Dartmouth, University of Lowell, University of Canberra (within Australia:
062-522422) ...
UC Berkeley Extension will have a one week X/Motif class for
programmers in San Francisco starting on July 29. The class will have a
hands-on lab. For more information contact UCBX at 415 323 8141.

Among the best places to find courses are at the various Unix
conferences -- Uniforum, Usenix, Unix Expo, Xhibition, the MIT X Technical
Conference, the ACM tutorial weeks, &c.

In addition, the X Consortium posts approximately quarterly a list of
unendorsed speakers and consultants who can provide talks on a variety of X
topics.

----------------------------------------------------------------------
~Subject: 3)! What conferences on X are coming up?

The XWorld Conference and Exhibition includes tutorials, panels,
presentations and vendor exhibits. The '93 show is March 3/8-3/11 in New York
City. Information: SIGS Publication Group at 212-274-9135.

The Xhibition 93 X trade show and conference, with tutorials, panels,
presentations, and vendor exhibits, will be held at the San Jose Convention
Center June 7-11, 1993. Information: +1 617 621 0060, [email protected]

The 1993 Andrew Technical Conference and Consortium Annual Meeting will
be held June 24-25, 1993, in Pittsburgh. Information:
[email protected]

The European X User Group holds an annual conference which typically
includes includes paper presentations and a vendor exhibit. EXUG'93 will be
held 9/16-9/17 in London. Information: [email protected] (?) or
[email protected], +44 (0) 223 426534, fax +44 (0) 223 420251.

The Motif show is held in Washington to coincide with the FedUnix and
the Federal Open Systems Conference (usually December). Information:
[email protected] or [email protected], 301-229-1062, fax 301-229-1063.

The MIT X Technical Conference is typically held in January in Boston.
Registration information is available from [email protected]

Other trade shows -- UnixExpo, Uniforum, Siggraph -- show an increasing
presence of X, including tutorials and exhibits.

----------------------------------------------------------------------
~Subject: 4) What X-related public mailing lists are available?

The xpert mailing list is the general, public mailing list on X
maintained by the X Consortium. The mailings are gatewayed, so xpert is almost
identical to the comp.windows.x Usenet newsgroup.

***If you get comp.windows.x, you don't need to ***
***be added to the xpert mailing list. ***

Otherwise, you can join the list to receive X information
electronically. It is best to find a local distribution; perhaps someone within
your company is already receiving the mailing. As a last resort, send mail to
[email protected] with a valid return electronic address.

The xannounce mailing list carries major X announcements, such as new
releases (including public patches from MIT), public reviews, adoption of
standards by the MIT X Consortium, and conference announcements. It does NOT
carry advertisements, source code, patches, or questions. If you already
receive the Usenet news group comp.windows.x.announce or the xpert mailing
list, you don't need to be added to the xannounce mailing list. Otherwise, to
subscribe, send a request to [email protected] Note: Only
redistribution addresses will be accepted for this list -- i.e. no personal
addresses. If you wish to receive xannounce yourself, please contact your mail
administrator to set up a local redistribution list and to put you on it.
comp.windows.x.apps is not gatewayed to a mailing list.

In addition, the X Consortium sponsors these public lists:
bug-clx CLX bug reports and discussions
x-ada X and ada
x11-3d people interested in X and 3d graphics
ximage people interested in image processing and X
xvideo discussion of video extensions for X
To subscribe to one of these lists, assuming no-one in your
organization already receives it, send mail to [email protected]
with the Subject line including the name of the LIST in caps and the request
"addition request". In the body of the message be sure to give an address for
your local distribution which is accessible from MIT (eddie.mit.edu).

A mailing list for topics related to OPEN LOOK is sponsored by Greg
Pasquariello of Unify corporation; send to [email protected] (or
openlook-request%[email protected]) for information.
A mailing list for bugs in the publicly-available version of XView
source, in particular, is sponsored by Sun; send for information to
[email protected]
A mailing list for topics related to Motif is sponsored by Kee Hinckley
of Alfalfa Software, Inc.; send to [email protected] for information.
(This group is gatewayed to comp.windows.x.motif.)
A mailing list for topics related to the XPM pixmap-format is sponsored
by Arnaud Le Hors of Group Bull; send to [email protected] for
information. [1/91]
A mailing list discussing InterViews can be subscribed to by sending to
[email protected]
A mailing list ([email protected]) for topics related to the port
of X11 to the Amiga can be subscribed by sending to [email protected] a
message containing
Subject: Adding myself to AMIGA-X11
SUBS AMIGA-X11 Your Real Name
A mailing list discussing ParcPlace's (formerly Solbourne's) OI (Object
Interface) toolkit can be subscribed to at [email protected]
A mailing list discussing multi-threaded Xlib can be subscribed to at
[email protected]

----------------------------------------------------------------------
~Subject: 5) How can I meet other X developers?

O'Reilly and Associates sponsors a mailing list for the use of X user
group organizers; subscribe by sending to [email protected] the message
"subscribe xgroups [email protected]".

Local area X user's groups are listed in Issue 4 of O'Reilly's X
Resource journal; a list may also be available from [email protected]

The French X User Group is called AFUX and is based in Sophia Antipolis
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; Fax: +33 93 95 48 57. [10/90]

The European X User Group was formed in 1989 to represent X users in
Europe. It holds technical conferences at regular intervals. The EXUG also
publishes a regular newsletter which is distributed free of charge to members.
The EXUG also runs a email mailing list for members which is frequently used to
address issues of European interest in X. The EXUG can be contacted at
[email protected], +44 (071) 225 8754, fax +44 (071) 823 9497.

GXUGiV is the German X User's Group in Vorbereitung ("in preparation")
being formed for X programmers and users; it is associated with the EXUG. All
interested should contact Olaf Heimburger (+49 30 7 79 54 64; and at
mcvax!unido!tub!olaf).

----------------------------------------------------------------------
~Subject: 6) What related FAQs are available?

Liam R. E. Quin ([email protected]) posts a FAQ on Open Look to
comp.windows.open-look.
Jan Newmarch ([email protected]) posts a FAQ on Motif to
comp.windows.x.motif.
Peter Ware ([email protected]) posts a FAQ for
comp.windows.x.intrinsics; it is on export in contrib/FAQ-Xt.
Art Mulder ([email protected]) posts to comp.windows.x a FAQ on
maximizing the performance of X.
Steve Kotsopoulos ([email protected]) posts to comp.windows.x a FAQ
about using X on Intel-based Unix systems.
The FAQ in alt.binaries.pictures contains information on viewing images
with X and on massaging image formats.
The FAQ in comp.mail.mh (gatewayed to [email protected]) includes a
section on xmh.
The FAQ in comp.lang.lisp contains information on several interface
tools and toolkits.
There exists a PEX/PHiGS FAQ.

----------------------------------------------------------------------
~Subject: 7) How do I ask a net-question so as to maximize helpful responses?

When asking for help on the net or X mailing lists, be sure to include
all information about your setup and what you are doing. The more specific you
are, the more likely someone will spot an error in what you are doing. Without
all the details, people who want to help you often have to guess -- if they are
able to respond at all.

Always mention what version of X you are using and where you got it
from. If your server came from a different source as the rest of your X system,
give details of that, too. Give the machine type, operating system, and O/S
version for both the client and server machine. It may also be appropriate to
mention the window manager, compiler, and display hardware type you are using.

Then tell exactly what you are doing, exactly what happens, and what
you expected/wanted to happen. If it is a command that fails, include the
exact transcript of your session in the message. If a program you wrote
doesn't work the way you expect, include as little of the source necessary
(just a small test case, please!) for readers to reproduce the problem.

----------------------------------------------------------------------
~Subject: 8) What publications discussing X are available?

The trade magazines (Unix World, Unix Review, Computer Language, etc.)
are publishing more articles on X. Two X-specific publications include:

- O'Reilly and Associates publishes "The X Resource: A Practical
Journal of the X Window System" (103 Morris St. #A, Sebastapol, CA 95472).
Editorial information: Adrian Nye, [email protected]

- The X Journal is started bi-monthly publication September 1991 on a
variety of X topics. Subscription information: The X Journal, Subscriber
Services, Dept XXX, P.O. Box 3000, Denville, NJ 07834, USA. Editorial
information: editors%[email protected]

----------------------------------------------------------------------
~Subject: 9) What are these common abbreviations/acronyms?

Xt: The X Toolkit Intrinsics is a library layered on Xlib which
provides the functionality from which the widget sets are built. An "Xt-based"
program is an application which uses one of those widget sets and which uses
Intrinsics mechanisms to manipulate the widgets.
Xmu: The Xmu library is a collection of Miscellaneous Utility functions
useful in building various applications and widgets.
Xaw: The Athena Widget Set is the MIT-implemented sample widget set
distributed with X11 source.
Xm: The OSF/Motif widget set from the Open Software Foundation; binary
kits are available from many hardware vendors.
Xhp (Xw): The Hewlett-Packard Widget Set was originally based on R2++,
but several sets of patches exist which bring it up to R3, as it is distributed
on the X11R4 tapes. Supplemental patches are available to use it with R4/R5.
CLX: The Common Lisp X Interface is a Common Lisp equivalent to Xlib.
XDMCP: The X Display Manager Protocol provides a uniform mechanism for
a display such as an X terminal to request login service from a remote host.
XLFD: The X Logical Font Description Conventions describes a standard
logical font description and conventions to be used by clients so that they
can query and access those resources.
RTFM: Common expert-speak meaning "please locate and consult the
relevant documentation -- Read the Forgotten Manual".
UTSL: A common expression meaning "take advantage of the fact that you
aren't limited by a binary license -- Use The Source, Luke".
API: Application-Programmer Interface. The function calls, etc., in
a programming library.
BDF: Bitmap Distribution Format; a human-readable format for uncompiled
X fonts.
GUI: graphical user interface.
UIL: the User Interface Language, part of OSF/Motif which lets
programmers specify a widget hierarchy in a simple "outline" form
WCL: the Widget Creation Language, a package which extends the
understanding of the Xt resource format such that a widget hierarchy and
actions on the widgets can be specified through the resources file
GIL: the file format put out by Sun's OpenWindows Developers Guide 3.0
UIMS: User Interface Management System

----------------------------------------------------------------------
~Subject: 10) What is the ICCCM? (How do I write X-friendly applications?)

The Inter-Client Communication Conventions Manual is one of the
official X Consortium standards documents that define the X environment. It
describes the conventions that clients must observe to coexist peacefully with
other clients sharing the same server. If you are writing X clients, you need
to read and understand the ICCCM, in particular the sections discussing the
selection mechanism and the interaction between your client and the window
manager. Get it either:
- as part of the R4 distribution from MIT
- in the later editions of the Scheifler/Gettys "X Window System" book
- as an appendix in the new version of O'Reilly's Volume 0, "X Protocol
Reference Manual." A version in old copies of their Volume 1 is obsolete.
The version in the Digital Press book is much more readable, thanks to
the efforts of Digital Press's editors to improve the English and the
presentation.

[from David Rosenthal, 10/90]

- the ICCCM was updated for R5; updates are published in O'Reilly's
"Programmer's Supplement for Release 5". The complete document is on the R5
tapes.

Alternate definition: the ICCCM is generally the M in "RTFM" and is
the most-important of the least-read X documents.

----------------------------------------------------------------------
~Subject: 11) What is the X Consortium, and how do I join?

The MIT X Consortium was formed in January of 1988 to further the
development of the X Window System and has as its major goal the promotion of
cooperation within the computer industry in the creation of standard software
interfaces at all layers in the X Window System environment.
MIT's role is to provide the vendor-neutral architectural and
administrative leadership required to make this work. Membership in the
Consortium open to any organization. There are two categories of membership,
Member (for large organizations) and Affiliate (for smaller organizations).
Most of the Consortium's activities take place via electronic mail,
with meetings when required. As designs and specifications take shape,
interest groups are formed from experts in the participating organizations.
Typically a small multi-organization architecture team leads the design, with
others acting as close observers and reviewers. Once a complete specification
is produced, it may be submitted for formal technical review by the Consortium
as a proposed standard. The standards process typically includes public
review (outside the Consortium) and a demonstration of proof of concept.
Your involvement in the public review process or as a Member or
Affiliate of the Consortium is welcomed.
Write to: Bob Scheifler, MIT X Consortium, Laboratory for Computer
Science, 545 Technology Square, Cambridge, MA 02139.

[For complete information see the XCONSORTIUM man page from the X11R4
distribution, from which this information is adapted.] [2/90]

----------------------------------------------------------------------
~Subject: 12) Just what are OPEN LOOK and Motif?

OPEN LOOK and Motif are two graphical user interfaces (GUIs). OPEN LOOK
was developed by Sun with help from AT&T and many industry reviewers; Motif was
developed by the Open Software Foundation (OSF) with input from many OSF
members.

OPEN LOOK is primarily a user-interface specification and style-guide;
there are several toolkits which can be used to produce OPEN LOOK applications.
Motif includes an API specification; the only sanctioned Motif toolkit is the
one from OSF. However, there are other toolkits which can be used to produce
programs which look and behave like OSF/Motif; one of these, ParcPlace's
(formerly Solbourne's) OI, is a "virtual toolkit" which provides objects in the
style of OPEN LOOK and Motif, at the user's choice.

OPEN LOOK GUI is also the name of a product from AT&T, comprising
their OPEN LOOK Intrinsics Toolkit and a variety of applications.

[Thanks to Ian Darwin, [email protected], 5/91]

----------------------------------------------------------------------
~Subject: 13) Just what is OpenWindows?

Open Windows (3.0) is a Sun product that encompasses: a window system
that combines a NeWS and X11-compliant server (X/NeWS); a user-interface
specification (OPEN LOOK) and a series of toolkits that implement it (including
the SunView-like XView and the Xt-based OLIT); Xlib and Xt implementations; and
a number of utilities (olwm window manager, filemgr, shelltool, etc.).

[thanks to Frank Greco ([email protected]), 8/90; 4/92]

----------------------------------------------------------------------
~Subject: 14) Just what is DECWindows?

DECWindows is a DEC product that encompasses: an X11 server; the XUI
toolkit, including the Dwt widget set and UIL; Xlib and Xt implementations; a
session manager; and a number of utilities (dxwm window manager, dxcalendar,
dxpsview, etc.).

(At some point Motif flavors of the toolkit and applications will be shipped.)
[8/90]

----------------------------------------------------------------------
~Subject: 15) What is PEX?

PEX is the "PHiGS Extension to X".
PHiGS stands for "Programmer's Hierarchical Interactive Graphics
System" and is essentially a library of functions that simplifies the creation
and manipulation of 3D graphics. Many platforms are capable of performing in
hardware the computations involved in rendering 3D objects; the extension
allows the client (PHiGS in this case) to take advantage of the specialized
hardware for 3D graphics.
Sun Microsystems is currently contracted to develop a freely
redistributable (copyright similar to the current X copyright) sample
implementation. Source and documentation are available in the R5 release.
Several vendors are currently selling independently-developed PEX servers for
their workstations and X terminals.

[last modified 10/91]

----------------------------------------------------------------------
~Subject: 16)! What is "low-bandwidth X" (LBX)? XRemote? PPP? SLIP? CSLIP?

There are several options for using X over serial lines:

SLIP - Serial Line IP; this is both a mechanism and a protocol for sending IP
packets over point-to-point serial links. It has been around for several years,
and implementations are available for many of the major TCP/IP implementations.
Most X Terminal vendors supply this as a checkoff item, although nobody really
ever uses it since it is horribly slow. The TCP/IP headers add 40 bytes per
packet and the TCP/IP encoding of the X protocol is rather verbose (rightfully
so; it is optimized for packing and unpacking over high-speed links).

CSLIP - Compressed header SLIP; this is a variant of SLIP that compresses the
40 bytes of TCP/IP headers down to about 5 or 6 bytes. It still doesn't do
anything about reencoding the X protocol. Modems that do compression can help,
but they increase packet latency (it takes time to dribble the uncompressed
data through typical serial interfaces, plus the compression assembly time).

PPP - Point-to-Point Protocol; this is an emerging standard for point-to-point
links over serial lines that has a more complete set of option negotiation than
SLIP. A growing number of people see the combination of PPP for the serial
line management and CSLIP for the header compression as becoming common for
running normal TCP/IP protocols over serial lines. Running raw X over the wire
still needs compression somewhere to make it usable.

XRemote - this is the name of both a protocol and set of products originally
developed by NCD for squeezing the X protocol over serial lines. In addition
to using a low level transport mechanism similar to PPP/CSLIP, XRemote removes
redundancies in the X protocol by sending deltas against previous packets and
using LZW to compress the entire data stream. This work is done by either a
pseudo-X server or "proxy" running on the host or in a terminal server. There
are several advantages to doing compression outside the modem:
(1)You don't *have* to have compressing modems in there if you wouldn't
otherwise be using them (e.g. if you were going to be directly
connected), and
(2)It reduces the I/O overhead by cutting down on the number of bytes that
have to cross the serial interface, and
(3)In addition to the effects of #2, it reduces the latency in delivering
packets by not requiring the modem to buffer up the data waiting for
blocks to compress.

LBX - Low Bandwidth X; this is an X Consortium project that is working on a
standard for this area. It is being chaired by NCD and Xerox and is using
NCD's XRemote protocol as a stepping stone in developing the new protocol. LBX
will go beyond XRemote by adding proxy caching of commonly-used information
(e.g. connection setup data, large window properties, font metrics, keymaps,
etc.) and a more efficient encoding of the X protocol. The hope is to have a
Standard ready for public review in the first half of next year and a sample
implementation available in R6.

Additional technical information about how XRemote works and a few notes on how
LBX might be different are available via anonymous ftp from export.lcs.mit.edu
in contrib/ in the following files:
XRemote-slides.ps slides describing XRemote
XRemote-LBX-diffs.ps more slides describing some of LBX

[information provided by Jim Fulton, [email protected]; 7/92]

There is also a set of slides on export from Jim Fulton's talk at
the 7th MIT X Technical Conference.

----------------------------------------------------------------------
~Subject: 17) TOPIC: USING X IN DAY-TO-DAY LIFE
----------------------------------------------------------------------
~Subject: 18)! What are all these different window managers?

The window manager in X is just another client -- it is not part of the
X window system, although it enjoys special privileges -- and so there is
no single window manager; instead, there are many which support different ways
for the user to interact with windows and different styles of window layout,
decoration, and keyboard and colormap focus. In approximate chronological order
(generally, the more recent ones are more conformant with the ICCCM):

wm: this simple title-bar window manager was phased out in R2 or R3
uwm: the Universal Window Manager is still popular for its speed,
although it is very outdated. Moved to contrib/ on the R4 tape.
twm (old): Tom's Window Manager was among the first non-MIT window
managers and offered the user a great deal of customization options in a
re-parenting window manager.
awm: the Ardent Window Manager remains a hotbed for hackers and offers
some features (dynamic menus) not found on more current window managers
cwm: cwm is part of the Andrew system.
rtl: Siemen's window manager tiles windows so that they don't overlap
and resizes the window with the focus to its preferred size.
dxwm: Digital's dxwm is part of the DECwindows offering
hpwm: HP's window manager offers a 3D look; it is a precursor of mwm
mwm: the Motif window manager is part of the OSF/Motif toolkit
tekwm: Tektronix's window manager offering
olwm (Sun): olwm implements the OPEN LOOK GUI and some of the Style
Guide functionality
olwm (AT&T): ditto
gwm: Bull's Generic Window Manager emulates others with a built-in
Lisp interpreter. Version 1.7h (10/91) is on the R5 contrib tape; 1.7m is on
avahi.inria.fr and export.lcs.mit.edu. [8/92]
m_swm: the Sigma window manager is on the R4 tape
pswm: Sun's PostScript-based pswm is part of the OpenWindows release
swm: Solbourne's swm is based on the OI toolkit and offers multiple
GUI support and also a panned virtual window; configuration information comes
from the resources file
twm (new): MIT's new Tab Window Manager from the R4 tape is a reworked
twm and is the basis for several derivatives, including the one on the R5 tape
vtwm: vtwm offers some of the virtual-desktop features of swm, with a
single-root window implementation; it is based on the R4 twm and is available
on archive servers. A new version, vtwm-5.0, is based on R5.9 and is available
from export. [3/92]
tvtwm: Tom's Virtual Tab Window Manager is also based on the R4 twm
and provides a virtual desktop modeled on the virtual-root window of swm. It is
available on archive servers
olvwm: the vtwm-style virtual-desktop added to Sun's olwm. It is
available on archive servers; version 3.3 [1/93] is on export.
mvwm: the vtwm-style virtual-desktop added to OSF's mwm. A beta version
is floating around (most recently from [email protected]) but requires a
source license to OSF/Motif 1.1.3 [3/92].
NCDwm: the window manager local to NCD terminals offers an mwm look
XDSwm: the window manager local to Visual Technology's terminals
ctwm: Claude Lecommandeur's ([email protected]) modification of the R5
twm offers 32 virtual screens in the fashion of HP vuewm; source is on export.
Version 2.1 [12/92; patch 1 2/93] also offers the window overview used in vtwm
and tvtwm.
vuewm: HP's MWM-based window manager offers configurable workspaces.
4Dwm: SGI's enhanced MWM

----------------------------------------------------------------------
~Subject: 19) Why does my X session exit when I kill my window manager (sic)?

It needn't. What is probably happening is that you are running your
window manager as the last job in your .xsession or .xinitrc file; your X
session runs only as long as the last job is running, and so killing your
window manager is equivalent to logging out. Instead, run the window manager in
the background, and as the last job instead invoke something safe like:
exec xterm -name Login -rv -iconic
or any special client of your devising which exits on some user action.
Your X session will continue until you explicitly logout of this window,
whether or not you kill or restart your window manager.

----------------------------------------------------------------------
~Subject: 20) Can I save the state of my X session, like toolplaces does?

Although no known window manager directly supports such a feature --
which may be equivalent to writing out a .xinitrc or .xsession file naming the
geometry and WM_COMMAND of each application (but olvwm may have something
close) -- there is a contributed application which does much of what you are
looking for, although it is not as complete as the SunView program toolplaces.
Look for the application "xplaces" on an archive-server near you. There are
several versions of this program floating around; look for a recent vintage.
[10/90]

----------------------------------------------------------------------
~Subject: 21) How do I use another window manager with DEC's session manager?

DEC's session manager will start dxwm up by default. To override this,
add to your .Xdefaults file something like this line, naming the full pathname:
sm.windowManagerName: /wherever/usr/bin/X11/your_favorite_wm

----------------------------------------------------------------------
~Subject: 22) How do I change the keyboard auto-repeat rate?

You can turn auto-repeat on or off by using "xset r on|off". The X
protocol, however, doesn't provide for varying the auto-repeat rate, which is
a capability not supported by all systems.
Some servers running on systems that support this, however, may provide
command-line flags to set the rate at start-up time. If you have control over
server start-up (see the man pages for xinit and xdm), you can invoke the
server with the chosen settings; for example, you can start the Xsun server
from MIT with the options "-ar1 350 -ar2 30" to reduce the sensitivity of the
keyboard.

----------------------------------------------------------------------
~Subject: 23) How do I remap the keys on my keyboard to produce a string?

There is no method of arranging for a particular string to be
produced when you press a particular key. The xmodmap client, which is useful
for moving your CTRL and ESC keys to useful places, just rearranges keys and
does not do "macro expansion."
Some (few) clients, including xterm and several X-based editors,
accept a translation resource such as:
xterm*VT100.Translations: #override \
F1: string("setenv DISPLAY unix:0")
which permits the shorthand F1 to be pressed to reset the display locally
within an xterm; it takes effect for new xterm clients. To include control
characters in the string, use \nnn, where nnn is the octal encoding of the
control character you want to include.
Window managers, which could provide this facility, do not yet; nor
has a special "remapper" client been made available.

----------------------------------------------------------------------

David B. Lewis faq%[email protected]

"Just the FAQs, ma'am." -- Joe Friday
--
David B. LewisTemporarily at but not speaking for Visual, Inc.
day: [email protected]: david%[email protected]

From: [email protected] (David B. Lewis)
Subject: comp.windows.x Frequently Asked Questions (FAQ) 2/5
Summary: useful information about the X Window System
Date: 8 Feb 93 14:37:08 GMT
Reply-To: faq%[email protected] (X FAQ maintenance address)

Archive-name: x-faq/part2
Last-modified: 1993/02/06

----------------------------------------------------------------------
~Subject: 24) How do I make a screendump or print my application?

The xwd client in the X11 distributions can be used to select a window
or the background. It produces an XWD-format file of the image of that window.
The file can be post-processed into something useful or printed with the xpr
client and your local printing mechanism. You can use this command:
csh% sleep 10; xwd -root > output.xwd &
and then spend 10 seconds or so setting up your screen; the entire current
display will be saved into the file output.xwd. Note that xwd also has an
undocumented (before R5) -id flag for specifying the window id on the
command-line. [There are also unofficial patches on export to xwd for
specifying the delay and the portion of the screen to capture.]

Two publicly-available programs which allow interactive definition of
arbitrary portions of the display and built-in delays are asnap and xgrabsc.
There are several versions of xgrabsc; version 2.2, available on export [8/92]
is the most recent.
xsnap includes some asnap features and supersedes it; it also renders
XPM output [version unknown]. It is available on export or avahi.inria.fr;
see xsnap-pl2.tar.Z.
A screen-dump and merge/edit program combining features of xwd and xpr
is available from vernam.cs.uwm.edu as xdump1.0.tar.Z. Information:
[email protected]

To post-process the xwd output of some of these tools, you can use xpr,
which is part of the X11 distribution. Also on several archives are xwd2ps
and XtoPS, which produce Encapsulated PostScript with trimmings suitable for
use in presentations (see export.lcs.mit.edu:contrib/xwd2ps.tar.Z and
contrib/ImageMagick.tar.Z). Also useful is the PBMPLUS package on many archive
servers; and the Xim package contains Level 2 color PostScript output.

The XV program can grab a portion of the X display, manipulate it, and
save it in one of the available formats. ImageMagick has similar capabilities.

Also:

Bristol Technology ([email protected], 203-438-6969) offers Xprinter
2.0, an Xlib API for PostScript and PCL printers; a demo is on ftp.uu.net
in vendor/Bristol/Xprinter.

ColorSoft 9619-459-8500) offers OPENprint package includes a screen-
capture facility, image-processing, and support for PostScript and
non-PostScript printers.

Some vendors' implementations of X (e.g. DECWindows and OpenWindows)
include session managers or other desktop programs which include "print portion
of screen" or "take a snapshot" options. Some platforms also have tools which
can be used to grab the frame-buffer directly; the Sun systems, for example,
have a 'screendump' program which produces a Sun raster file. Some X terminals
have local screen-dump utilities to write PostScript to a local serial printer.

Some vendors' implementations of lpr (e.g. Sony) include direct
support for printing xwd files, but you'll typically need some other package
to massage the output into a useful format which you can get to the printer.

----------------------------------------------------------------------
~Subject: 25) How do I make a color PostScript screendump of the X display?

If you need color PostScript in particular, you can
- grab the screen-image using a program which can produce color
PostScript, such as xgrabsc and xv
- grab the screen-image using xwd and post-process xwd into color PS.
You can do this using xwd2ps or the XtoPS program from the ImageMagick
distribution. The PBMPLUS package is also good for this, as is the Xim package.

----------------------------------------------------------------------
~Subject: 26) How do I make a screendump including the X cursor?

This can't be done unless the X server has been extended. Consider
instead a system-dependent mechanism for, e.g., capturing the frame-buffer.

----------------------------------------------------------------------
~Subject: 27) How do I convert/view Mac/TIFF/GIF/Sun/PICT/img/FAX images in X?

The likeliest program is an incarnation of Jef Poskanzer's useful++
Portable Bitmap Toolkit, which includes a number of programs for converting
among various image formats. It includes support for many types of bitmaps,
gray-scale images, and full-color images. PBMPLUS has been updated recently;
the most recent version [12/91] is on export in contrib/pbmplus10dec91.tar.Z.
Another tool is San Diego Supercomputing Center's IMtools ('imconv' in
particular), which packages the functionality of PBM into a single binary.
It's available anonymous ftp from sdsc.edu (132.249.20.22).

Useful for viewing some image-formats is Jim Frost's xloadimage, a
version of which is in the R4 directory contrib/clients/xloadimage; there are
later versions available, including contrib/xloadimage.3.03.tar.Z on export.
Graeme Gill's updates to an earlier version of xloadimage are also on export;
see xli.README and xli.tar.Z.uu.

xv (X Image Viewer), written by [email protected] (John Bradley),
can read and display pictures in Sun Raster, PGM, PBM, PPM, X11 bitmap, TIFF,
GIF and JPEG. It can manipulate on the images: adjust, color, intensity,
contrast, aspect ratio, crop). It can save images in all of the aforementioned
formats plus PostScript. It can grab a portion of the X display, manipulate on
it, and save it in one of the available formats. The program was updated 5/92;
see the file contrib/xv-2.21.tar.Z on export.lcs.mit.edu.

The Fuzzy Pixmap Manipulation, by Michael Mauldin .
Conversion and manipulation package, similar to PBMPLUS. Version 1.0 available
via FTP as nl.cs.cmu.edu:/usr/mlm/ftp/fbm.tar.Z, uunet.uu.net:pub/fbm.tar.Z,
and ucsd.edu:graphics/fbm.tar.Z.

The Img Software Set, by Paul Raveling , reads
and writes its own image format, displays on an X11 screen, and does some image
manipulations. Version 1.3 is available via FTP on expo.lcs.mit.edu as
contrib/img_1.3.tar.Z, along with large collection of color images.

The Utah RLE Toolkit is a conversion and manipulation package similar
to PBMPLUS. Available via FTP as cs.utah.edu:pub/urt-*,
weedeater.math.yale.edu:pub/urt-*, and freebie.engin.umich.edu:pub/urt-*.

Xim, The X Image Manipulator, by Philip Thompson, does essential
interactive displaying, editing, filtering, and converting of images. There is
a version in the X11R4 contrib area; but a more recent version (using R4 and
Motif 1.1) is available from gis.mit.edu (18.80.1.118). Xim reads/writes gif,
xwd, xbm, tiff, rle, xim, (writes level 2 eps) and other formats and also has a
library and command-line utilities for building your own applications.

ImageMagick [2.2; 12/92] by [email protected] can be retrieved from
export's contrib area. It is a collection of utilities to transform and display
images on any X server. The tool uses the MIFF format; filters to and from MIFF
from other popular formats (PPM, TIFF, GIF, SUN Raster, etc) are included.

xtiff is a tool for viewing a TIFF file in an X window. It was written
to handle as many different kinds of TIFF files as possible while remaining
simple, portable and efficient. xtiff illustrates some common problems
with building pixmaps and using different visual classes. It is distributed
as part of Sam Leffler's libtiff package and it is also available on
export.lcs.mit.edu, uunet.uu.net and comp.sources.x. [[email protected],10/90]
xtiff 2.0 was announced in 4/91; it includes Xlib and Xt versions.

A version of Lee Iverson's ([email protected]) image-viewing tool
is available as contrib/vimage-0.9.3.tar.Z on export.lcs.mit.edu. The package
also includes an ImageViewPort widget and a FileDialog widget. [12/91;5/92]

[some material from Larry Carroll ([email protected]), 5/91]

----------------------------------------------------------------------
~Subject: 28) How can I change the titlebar of my xterm window?

The solution involves sending an escape sequence to xterm which will
cause it to update the property which the window manager relies upon for the
string which appears in the window titlebar.
A solution is as easy as typing this in an xterm running a shell:
echo "ESC]2;TEXT^G"
where ESC is the escape key, TEXT is the string you wish to have displayed,
and ^G is a Control-G (the BEL character).

Here is a more complicated csh alias which changes the titlebar to
the current working directory when you change directories:
alias newcd 'cd \!*; echo -n ESC]2\;$cwd^G'

The digit '2' in these strings indicates to xterm that it should
change only the title of the window; to change both the title and the name
used in the icon, use the digit '0' instead, and use '1' to change only the
icon name.

Note: another way to do this, which prevents an incorrect display of
the local directory if a modified `cd` is used in a subshell, is to wrap the
escape sequences into the PS1 prompt itself.

Note: on an IBM RS/6000 is may be necessary to begin the sequence with
a ^V.

----------------------------------------------------------------------
~Subject: 29) Where can I find the xterm control sequences?

The best source of such information is in your R5 sources in the file
ctlseqs.ms; a PostScript version is in mit/hardcopy/clients/ctlseqs.PS.Z.

O'Reilly's Volume 3, the X User's Guide, includes an R5 version of the control
sequences; the standard volume will be available 3/93, and a Motif version of
the book is available now. The current (R4) guide includes an outdated version
of the control sequences. [1/93]

Other good sources of information include the R4 version of that document
and also the file in the R4 sources called mit/clients/xterm/ctlseq2.txt, a
compilation put together by Skip Montanaro (GE CR&D) listing the VT100
sequences. It dates from R3 but is fairly accurate. A hardcopy version was
published in the December 1989 XNextEvent (the XUG newsletter).

In a pinch, a VT100 manual will do.

[last updated 10/91]

----------------------------------------------------------------------
~Subject: 30) Why does the R3 xterm, et al, fail against the R4 server?

The value given to a window's do_not_propagate mask is the likely
culprit. R3 allowed bogus values to be set, and early version of both Andrew
and InterViews did, as well. Similar problems also occur in the R3 Motif
PanedWindow widget.
If it is impossible to fix client source -- and many systems still ship
the R3 xterm -- use 'xset bc' to put the X11R4 server into bug-compatibility
mode.

----------------------------------------------------------------------
~Subject: 31) How can I use characters above ASCII 127 in xterm ?

In order to use special characters such as the o-umlaut, you need to
"stty pass8" but also to use a charcell ISO8859 font, such as
XTerm*font: -*-*-medium-r-normal-*-*-130-*-*-c-*-iso8859-1
XTerm*boldfont:-*-*-bold-r-normal-*-*-130-*-*-c-*-iso8859-1
[The family is intentionally unspecified in this example.]

In addition, you may want to set this in your shell:
setenv LC_CTYPE iso_8859_1

For a given character above 127, you can determine the key to use with
the Alt modifier by finding the equivalent character below 127 (try using
`man ascii`). For example, o-umlaut (v) is Alt-v and the section character (')
is Alt-'.

[thanks to Greg Holmberg (greg%[email protected]) and Stephen Gildea
([email protected]); 6/92]

----------------------------------------------------------------------
~Subject: 32) Why are my xterm menus so small?

You are probably setting the geometry small accidentally. If you give
a resource specification like this:
xterm*geometry: 80x24
then you are asking for all widgets under xterm to have their geometry set to
80x24. For the main window, this is OK, as it uses characters for its size.
But its popup menus don't; they are in pixels and show up small. To set only
the terminal widget to have the specified geometry, name it explicitly:
xterm*VT100.geometry: 80x24

----------------------------------------------------------------------
~Subject: 33) How can I print the current selection?

You could paste it into an xterm after executing the lpr command.
However, a program by Richard Hesketh ([email protected]) specifically for
manipulating the selection will help; e.g.
% xselection PRIMARY | lpr
finds the primary selection and prints it. This command can be placed in a
window-manager menu or in shell-scripts. xselection also permits the setting of
the selection and other properties. A version is on export.
Also available is ria.ccs.uwo.ca:pub/xget_selection.tar.Z, which can be
adapted to do this.

----------------------------------------------------------------------
~Subject: 34)! How does Xt use environment variables in loading resources?

You can use several environment variables to control how resources are
loaded for your Xt-based programs -- XFILESEARCHPATH, XUSERFILESEARCHPATH, and
XAPPLRESDIR. These environment variables control where Xt looks for
application-defaults files as an application is initializing. Xt loads at most
one app-defaults file from the path defined in XFILESEARCHPATH and another from
the path defined in XUSERFILESEARCHPATH.

Set XFILESEARCHPATH if software is installed on your system in such a
way that app-defaults files appear in several different directory hierarchies.
Suppose, for example, that you are running Sun's Open Windows, and you also
have some R4 X applications installed in /usr/lib/X11/app-defaults. You could
set a value like this for XFILESEARCHPATH, and it would cause Xt to look up
app-defaults files in both /usr/lib/X11 and /usr/openwin/lib (or wherever your
OPENWINHOME is located):
setenv XFILESEARCHPATH /usr/lib/X11/%T/%N:$OPENWINHOME/lib/%T/%N

The value of this environment variable is a colon-separated list of pathnames. The pathnames contain replacement characters as follows (see
XtResolvePathname()):

%N The value of the filename parameter, or the
application's class name.
%T The value of the file "type". In this case, the
literal string "app-defaults"
%C customization resource (R5 only)
%S Suffix. None for app-defaults.
%L Language, locale, and codeset (e.g. "ja_JP.EUC")
%l Language part of %L (e.g. "ja")
%t The territory part of the display's language string
%c The codeset part of the display's language string

Let's take apart the example. Suppose the application's class name is
"Myterm". Also, suppose Open Windows is installed in /usr/openwin. (Notice the
example omits locale-specific lookup.)
/usr/lib/X11/%T/%N means /usr/lib/X11/app-defaults/Myterm
$OPENWINHOME/lib/%T/%N means /usr/openwin/lib/app-defaults/Myterm

As the application initializes, Xt tries to open both of the above
app-defaults files, in the order shown. As soon as it finds one, it reads it
and uses it, and stops looking for others. The effect of this path is to
search first in /usr/lib/X11, then in /usr/openwin.

Let's consider another example. This time, let's set
XUSERFILESEARCHPATH so it looks for the file Myterm.ad in the current working
directory, then for Myterm in the directory ~/app-defaults.
setenv XUSERFILESEARCHPATH ./%N.ad:$HOME/app-defaults/%N

The first path in the list expands to ./Myterm.ad. The second expands
to $HOME/app-defaults/Myterm. This is a convenient setting for debugging
because it follows the Imake convention of naming the app-defaults file
Myterm.ad in the application's source directory, so you can run the application
from the directory in which you are working and still have the resources loaded
properly. NOTE: when looking for app-default files with XUSERFILESEARCHPATH,
for some bizarre reason, neither the type nor file suffix is defined so %T and
%S are useless.

With R5, there's another twist. You may specify a customization
resource value. For example, you might run the "myterm" application like this:
myterm -xrm "*customization: -color"

If one of your pathname specifications had the value
"/usr/lib/X11/%T/%N%C" then the expanded pathname would be
"/usr/lib/X11/app-defaults/Myterm-color" because the %C substitution character
takes on the value of the customization resource.

The default XFILESEARCHPATH, compiled into Xt, is:
/usr/lib/X11/%L/%T/%N%C:\ (R5)
/usr/lib/X11/%l/%T/%N%C:\ (R5)
/usr/lib/X11/%T/%N%C:\ (R5)
/usr/lib/X11/%L/%T/%N:\
/usr/lib/X11/%l/%T/%N:\
/usr/lib/X11/%T/%N

(Note: some sites replace /usr/lib/X11 with a ProjectRoot in
this batch of default settings.)

The default XUSERFILESEARCHPATH, also compiled into Xt, is
/%L/%N%C:\ (R5)
/%l/%N%C:\ (R5)
/%N%C:\ (R5)
/%L/%N:\
/%l/%N:\
/%N:

is either the value of XAPPLRESDIR or the user's home directory
if XAPPLRESDIR is not set. If you set XUSERFILESEARCHPATH to some value other
than the default, Xt ignores XAPPLRESDIR altogether.

Notice that the quick and dirty way of making your application find
your app-defaults file in your current working directory is to set XAPPLRESDIR
to ".", a single dot. In R3, all this machinery worked differently; for R3
compatibilty, many people set their XAPPLRESDIR value to "./", a dot followed
by a slash.

[Thanks to Oliver Jones ([email protected]); 2/93.]

----------------------------------------------------------------------
~Subject: 35) How to I have the R4 xdm put a picture behind the log-in window?

The answer lies in changing xdm's xrdb resource in the xdm-config file to run a
program to change the background before loading the resources; for example,
your /usr/lib/X11/xdm/xdm-config file may add the line
DisplayManager.0.authorize: false
to permit unrestricted access to the display before log-in (beware!) and also
DisplayManager*xrdb:/usr/lib/X11/xdm/new.xrdb
where that file does something (for all connections) along the lines of:
#!/bin/sh
#comes in with arguments: -display :0 -load /usr/lib/X11/xdm/Xresources
/usr/bin/X11/xsetroot -display $2 -bitmap /usr/lib/X11/xdm/new.bitmap
/usr/bin/X11/xrdb $*
Substitute xloadimage or xv for xsetroot, to taste. Note that this is a
general hack that can be used to invoke a console window or any other client.

[Thanks to Jay Bourland ([email protected]), 9/91]

----------------------------------------------------------------------
~Subject: 36) Why isn't my PATH set when xdm runs my .xsession file?

When xdm runs your .xsession it doesn't source your .cshrc or .login
files. You can set the path explicitly as you normally could for any SH script;
or you can place all environment-setting statements in a separate file and
source it from both the .xsession file and your shell configuration file; or,
if you set your PATH in your .cshrc file, the normal place, you can make your
.xsession have PATH set simply by making it a csh script, i.e. by starting
your .xsession file off with "#!/bin/csh".
If this doesn't work, also try starting off with:
#!/bin/sh
# Reset path:
PATH=`csh -c 'echo $PATH'` ; export PATH

----------------------------------------------------------------------
~Subject: 37) How do I keep my $DISPLAY when I rlogin to another machine?

There are several ways to avoid having to do a "setenv DISPLAY ..."
whenever you log in to another networked UNIX machine running X.
One solution is to use the clients/xrsh on the R5 contrib tape. It
includes xrsh, a script to start an X application on remote machine, and
xrlogin, a script to start a local xterm running rlogin to a remote machine.
A more recent version is on export in xrsh-5.4.shar.
One solution is to use the xrlogin program from der Mouse
([email protected]). You can ftp caveat-emptor versions from
132.206.1.1, in X/xrlogin.c and X/xrlogind.c. The program packages up $TERM and
$DISPLAY into a single string, which is stuffed into $TERM. rlogin then
propagates $TERM normally; your .cshrc on the remote machine should contain
eval `xrlogind`
where xrlogind is a program that checks $TERM and if it is of the special
format it recognizes, unpacks it and spits out setenv and unsetenv commands to
recreate the environment variables. [11/90]

In addition, if all you need to do is start a remote X process on
another host, and you find
rsh -n /usr/bin/X11/xterm -display $DISPLAY
too simple (DISPLAY must have your real hostname), then this version of xrsh
can be used to start up remote X processes. The equivalent usage would be
xrsh xterm

#! /bin/sh
# start an X11 process on another host
# Date: 8 Dec 88 06:29:34 GMT
# From: Chris Torek
# rsh $host -n "setenv DISPLAY $DISPLAY; exec [email protected] &/dev/null"
#
# An improved version:
# rXcmd (suggested by John Robinson, [email protected])
# (generalized for sh,ksh by Keith Boyer, [email protected])
#
# but they put the rcmd in ()'s which left zombies again. This
# script combines the best of both.

case $# in
[01]) echo "Usage: $0 host x-cmd [args...]";;
*)
case $SHELL in
*csh*) host="$1"; shift
xhost "$host" > /dev/null
rsh "$host" -n \
"setenv TERM xterm; setenv DISPLAY `hostname`:0; \
exec $* & /dev/null" &
;;
*sh)
host="$1"; shift
xhost "$host" > /dev/null
rsh "$host" -n \
"TERM=xterm export TERM; \
DISPLAY=`hostname`:0 export DISPLAY; \
LD_LIBRARY_PATH=/usr/X11/lib export LD_LIBRARY_PATH; \
PATH=\$PATH:/usr/X11/bin:/usr/bin/X11:/usr/local/bin; \
export PATH; \
exec $* < /dev/null > /dev/null 2>&1" &
;;
esac
;;
esac

----------------------------------------------------------------------
~Subject: 38) How can I design my own font?

One way is to use the "bitmap" client or some other bitmap-editor (e.g.
Sun's icon-editor tool, post-processed with pbmplus) to design the individual
characters and then to do some large amount of post-processing to concatenate
them into the BDF format. See Ollie Jones's article in the November 91 X
Journal for more information.
The R3 contrib/ area (in fonts/utils/ and in clients/xtroff) contained
a number of useful utilities, including some to convert between BDF font format
and a simple character format which can be edited with any text editor.
An easier way is to use the "xfed" client to modify an existing font; a
version is on the R4 or R5 X11R5 contrib tape in contrib/clients/xfed. Xfed is
available for anonymous ftp on ftp.Informatik.Uni-Dortmund.DE [129.217.64.63],
possibly as file /pub/windows/X/Diverse-X11-Sourcen/xfed.tar.Z. It can produce
BDF-format fonts which can be compiled for a variety of X servers.
The xfedor client from Group Bull permits creation of bitmaps, cursors,
XPM1 pixmaps, and fonts. Binaries for common machines are on avahi.inria.fr in
/pub; in addition, the sources (an old Xlib implementation) have been placed
[5/91] in export:/contrib.
If you are a MetaFont user you can use "mftobdf" from the SeeTeX
distribution to convert PK, GF, and PXL fonts to BDF format; the distribution
is on ftp.cs.colorado.edu and on export.lcs.mit.edu.
The GNU package fontutils-0.4.tar.Z on prep.ai.mit.edu includes xbfe,
a font editor, and a number of utilities for massaging font formats.
The O'Reilly X Resource issue #2 contains an article on using these
tools to modify a font.
Fonts can be resized with Hiroto Kagotani's bdfresize; a new version is
in ftp.cs.titech.ac.jp:/X11/contrib.

----------------------------------------------------------------------
~Subject: 39) Why does adding a font to the server not work (sic)?

After you have built the font using your system's font-compiler,
installed it in some directory, and run `mkfontdir` or your system's equivalent
(e.g. bldfamily for OpenWindows) in that directory, be sure to use `xset +fp
$dir` to add that full path-name to the server's font-path, *or* if the
directory is already in the path, use `xset fp rehash` so that the new fonts in
that directory are actually found; it is this last step that you're probably
leaving out. (You can also use `xset q` to make sure that that directory is in
the path.)
Sometimes your "xset +fp $dir" command fails with a BadValue error:
X Error of failed request:BadValue
(integer parameter out of range for operation)
Major opcode of failed request: 51 (X_SetFontPath)

This means the X server cannot find or read your font directory, or
that your directory does not look like a font directory to the server. (The
mention of an "integer parameter" in the message is spurious.)

-- Is the font directory you're specifying readable from the SERVER's file
system? Remember, it's the server, not the client, which interprets your
font directory. Trouble in this area is especially likely when you issue an
xset command with shell metacharacters in it (e.g. "xset +fp ~/myfonts") and
the server is an X terminal or managed by xdm.

-- Is the directory really a font directory? If you're running an MIT server
(or most varieties of vendor servers) look in the directory for the file
"fonts.dir". If you can't find that file, run mkfontdir(1). (If you're
running OpenWindows, look for the file "Families.list". If you can't find
it, run bldfamily(1).)

-- If you're in a site where some people run X11Rn servers and others run a
proprietary server with nonstandard font formats (OpenWindows, for
example), make sure the font directory is right for the server you're using.
Hint: if the directory contains .pcf and/or .snf files, it won't work for
Open Windows. If the directory contains .ff and/or .fb files, it won't work
for X11Rn.

[thanks to der Mouse ([email protected]) and to Oliver Jones
([email protected]); 7/92 ]

----------------------------------------------------------------------
~Subject: 40) How do I convert a ".snf" font back to ".bdf" font?

A tool called "snftobdf 1.4" is part of the bdftools package, which is
available from export.lcs.mit.edu:contrib/bdftools.tar.Z and from
crl.nmsu.edu:pub/misc/bdftools.tar.Z. Sources have been posted to fj.sources on
JUNET and should be appearing on comp.sources.x. [2/91]

----------------------------------------------------------------------
~Subject: 41) What is a general method of getting a font in usable format?

der Mouse's getbdf is one solution; it connects to a server and
produces a .BDF file for any font the server is willing to let it. It can be
used as an anything-to-BDF converter, but requires access to a server that can
understand the font file, thus is both more and less powerful than other tools
such as snftobdf. getbdf is on 132.206.1.1 in X/getbdf.c or available via mail
from [email protected] [5/91]
In addition, the R5 program "fstobdf" can produce bdf for any font that
the R5 server has access to.

----------------------------------------------------------------------
~Subject: 42) How do I use DECwindows fonts on my non-DECwindows server?

The DECwindows fonts typically don't exist on a non-DEC installation,
but rewrite rules can be used to alias fonts used by DECwindows applications to
standard MIT fonts of similar characteristics and size. Pick up the file
contrib/DECwindows_on_X11R4_font.aliases from export.lcs.mit.edu; this file is
for a standard MIT R4 server. It can also serve as a starting point for
creating a similar aliases file for the Open Windows server or other servers
which do not use the MIT font scheme.

----------------------------------------------------------------------
~Subject: 43) How do I add ".bdf" fonts to my DECwindows server?

The format of fonts preferred by DEC's X server is the ".pcf" format.
You can produce this compiled format from the .bdf format by using DEC's dxfc
font-compiler. Note that the DEC servers can also use raw .bdf fonts, with a
performance hit.

----------------------------------------------------------------------
~Subject: 44) How can I set the backgroundPixmap resource in a defaults file?
I want to be able to do something like this:
xclock*backgroundPixmap: /usr/include/X11/bitmaps/rootweave

You can't do this. The backgroundPixmap resource is a pixmap of the
same depth as the screen, not a bitmap (which is a pixmap of depth 1). Because
of this, writing a generic String to Pixmap converter is impossible, since
there is no accepted convention for a file format for pixmaps. Therefore,
neither the X Toolkit or the Athena widget set define a String to Pixmap
converter, because there is no converter you cannot specify this value as a
resource. The Athena widget set does define a String to Bitmap converter for
use in many of its widgets, however.
[courtesy Chris D. Peterson (now [email protected]), 4/90]

However:
A specific converter which encapsulates much of the functionality of
the xloadimage package by Jim Frost was posted 12/90 by Sebastian Wangnick
([email protected]); it permits loading of a number of
image formats as a pixmap.

The leading general-purpose format for pixmaps is the XPM format used
by Groupe Bull in several of its programs, including the GWM window manager, by
AT&T in its olpixmap editor, and by ICS in its interface builder. XPM
distribution, available on export as contrib/xpm.tar.Z, includes read/write
routines which can easily be adapted to converters by new widgets which want to
allow specification of pixmap resources in the above manner. See information
on the xpm-talk mailing list above. XPM 3.0c was announced in 10/91 and is
available from export.lcs.mit.edu and avahi.inria.fr; it should be on the R5
contrib tape. XPM 3.2c is now available. [1/93].

----------------------------------------------------------------------
~Subject: 45) Why can't I override translations? Only the first item works.

You probably have an extra space after the specification of the first
item, like this:
basic*text.translations: #override \
Ctrla: beginning-of-line() \n\
Ctrle: end-of-line()
^ extra space
The newline after that space is ending the translation definition.
[Thanks to Timothy J. Horton, 5/91]

----------------------------------------------------------------------
~Subject: 46) How can I have xclock or oclock show different timezones?

One solution is xchron, in Volume 6 of comp.sources.x, which can show
the time for timezones other than the local one.
Alternatively, you can probably set the timezone in the shell from
which you invoke the xclock or oclock, or use a script similar to this:
#!/bin/sh
TZ=PST8PDT xclock -name "San_Luis_Obispo_CA" 2> /dev/null &
TZ=EST5EDT xclock -name "King_Of_Prussia_PA" 2> /dev/null &

----------------------------------------------------------------------
~Subject: 47) I have xmh, but it doesn't work. Where can I get MH?

The xmh mail-reader requires the Rand MH mail/message handling system,
which is not part of the UNIX software distribution for many machines. A list
of various ftp, uucp, e-mail and US-mail sites for both xmh and MH is given in
the monthly MH FAQ; one source is ics.uci.edu in the file pub/mh/mh-6.7.tar.Z.
If you do not receive the comp.mail.mh newsgroup or the MH-users mailing list,
you can request a copy of the FAQ, which also includes a section on xmh,
by sending mail to [email protected] containing the request
"send usenet/news.answers/mh-faq".

----------------------------------------------------------------------
~Subject: 48) Why am I suddenly unable to connect to my Sun X server?
After a seemingly random amount of time after the X server has been started, no
other clients are able to connect to it.

The default cron cleanup jobs supplied by Sun (for 4.0.3, at least)
delete "old" (unreferenced) files from /tmp -- including /tmp/.X11-unix, which
contains the socket descriptor used by X. The solution is to add "! -type s" to
the find exclusion in the cron job.
[10/90]

----------------------------------------------------------------------
~Subject: 49) Why don't the R5 PEX demos work on my mono screen?

The R5 sample server implementation works only on color screens, sorry.

----------------------------------------------------------------------
~Subject: 50) How do I get my Sun Type-[45] keyboard fully supported by Xsun?

Many users wants the Num Lock key to light the Num Lock LED and have the
appropriate effect on the numeric keypad. The Xsun server as distributed by MIT
doesn't do this but there are two different patches available.

The first patch is written by Jonathan Lemon and fixes the Num Lock related
problems. It is available from export.lcs.mit.edu in the file
contrib/Xsun-R5.numlock_patch.Z .

The second is written by Martin Forssen and fixes the Num Lock and Compose keys
and adds support for the different national keyboard layouts for Type-4 and
Type-5 keyboards. This patch is available from export.lcs.mit.edu in
contrib/sunkbd.921216.tar.Z (updated 12/92) or via email from
[email protected]

[thanks to Martin Forssen ([email protected] or [email protected]), 8/92]

A set of patches by William Bailey ([email protected]) was posted to newsgroups
11/92 to provide support for the Type-5 keyboard.

----------------------------------------------------------------------
~Subject: 51) How do I report bugs in X?

Generally, report bugs you find to the organization that supplied you
with the X Window System. If you received the R5 source distribution directly
from MIT, please read the file mit/bug-report for instructions. [Look in
mit/doc/bugs/bug-report in R4.]

[Thanks to Stephen Gildea , 5/91; 12/91]

----------------------------------------------------------------------
~Subject: 52) Why do I get "Warning: Widget class version mismatch"?

This error, which typically goes on to say, "widget 11004 vs.
intrinsics 11003" indicates that the header files you included when building
your program didn't match the header files that the Xt library you're linking
against was built with; check your -I include path and -L link-path to be sure.
However, the problem also occurs when linking against a version of the
X11R4 Xt library before patch 10; the version number was wrong. Some Sun OW
systems, in particular, were shipped with the flawed version of the library,
and applications which link against the library typically give the warnings you
have seen.

----------------------------------------------------------------------
~Subject: 53) Where can I find a dictionary server for xwebster?

Webster's still owns the copyright to the on-line copies of Webster's
Dictionary which are found at various (university) sites. After it became aware
that these sites were then acting as servers for other sites running xwebster
and gnuemacs-webster, it asked that server sites close off external access.
[The NeXT machine apparently is also licensed to have the dictionary. A
Webster daemon for NeXT machines is available from iuvax.cs.indiana.edu
(129.79.254.192) in "pub/webster/NeXT-2.0".]
Unless you want to get a legal on-line copy yourself or can find a site
which can grant you access, you are probably out of luck.

However, if you are a legitimate site, you'll want to pick up the
latest xwebster, as-is on export:contrib/xwebster.tar.Z [10/91]; the file
xwebster.README includes discussions of the availability, illegality, and
non-availability of dictionary servers.

[courtesy [email protected] (Steve Miller) and [email protected] (Niels
Mayer) 11/90]

----------------------------------------------------------------------
~Subject: 54) TOPIC: OBTAINING X AND RELATED SOFTWARE AND HARDWARE
----------------------------------------------------------------------
~Subject: 55) Is X public-domain software?

No. The X software is copyrighted by various institutions and is not
"public domain", which has a specific legal meaning. However, the X
distribution is available for free and can be redistributed without fee.
Contributed software, though, may be placed in the public domain by
individual authors.

----------------------------------------------------------------------
~Subject: 56) How compatible are X11R3, R4, and R5? What changes are there?

The Release Notes for each MIT release of X11 specify the changes from the
previous release. The X Consortium tries very hard to maintain compatibility
across releases. In the few places where incompatible changes were necessary,
details are given in the Release Notes. Each X11 distribution site on the
network also offers the Release Notes that go with the release they offer; the
file typically can be found at the top of the distribution tree.

[Stephen Gildea, 1/92]

The comp.windows.x.intrinsics FAQ-Xt lists Xt differences among these versions.

----------------------------------------------------------------------
~Subject: 57) Where can I get X11R5 (source and/or binaries)?

Information about MIT's distribution of the sources on 6250bpi and QIC-24 tape
and its distribution of hardcopy of the documents is available from
Software Center, Technology Licensing Office, Massachusetts Institute of
Technology, 28 Carleton Street, Room E32-300, Cambridge MA 02142-1324,
phone: 617-258-8330.

You will need about 100Mb of disk space to hold all of Core and 140MB to hold
the Contrib software donated by individuals and companies.

PLEASE use a site that is close to you in the network.

Note that the RELEASE notes are generally available separately in the same
directory; the notes list changes from previous versions of X and offer a
guide to the distribution.

North America anonymous FTP:

Californiagatekeeper.dec.compub/X11/R5
16.1.0.2
Californiasoda.berkeley.edupub/X11R5
128.32.131.179
Indianamordred.cs.purdue.edupub/X11/R5
128.10.2.2
Marylandftp.brl.milpub/X11R5
128.63.16.158
(good for MILNET sites)
Massachusettscrl.dec.compub/X11/R5
192.58.206.2
Massachusettsexport.lcs.mit.edupub/R5
18.24.0.12
(crl.dec.com is better)
Michiganmerit.edupub/X11R5
35.1.1.42
Missouriwuarchive.wustl.edupackages/X11R5
128.252.135.4
Montanaftp.cs.montana.edupub/X.V11R5
192.31.215.202
New Mexicopprg.eece.unm.edupub/dist/X11R5
129.24.24.10
New Yorkazure.acsu.buffalo.edupub/X11R5
128.205.7.6
North Carolinacs.duke.edudist/sources/X11R5
128.109.140.1
Ohioftp.cis.ohio-state.edupub/X.V11R5
128.146.8.52
Ontarioftp.cs.utoronto.capub/X11R5
128.100.1.105
Washington DCx11r5-a.uu.netX/R5
192.48.96.12
Washington DCx11r5-b.uu.netX/R5
137.39.1.12

Europe/Middle East/Australia anonymous FTP:

Australiamunnari.oz.auX.V11/R5
128.250.1.21
Denmarkfreja.diku.dkpub/X11R5
129.142.96.1
United Kingdomsrc.doc.ic.ac.ukgraphics/X.V11R5
146.169.3.7
hpb.mcc.ac.ukpub/X11r5
130.88.200.7
Finlandnic.funet.fipub/X11/R5
128.214.6.100
Francenuri.inria.frX/X11R5
128.93.1.26
Germanyftp.germany.eu.netpub/X11/X11R5
192.76.144.129
Israelcs.huji.ac.ilpub/X11R5
132.65.6.5
Italyghost.sm.dsi.unimi.itpub/X11R5
149.132.2.1
Netherlandsarchive.eu.netwindows/X/R5
192.16.202.1
Norwayugle.unit.nopub/X11R5
129.241.1.97
Norwaynac.nopub/X11R5
129.240.2.40
Switzerlandnic.switch.chsoftware/X11R5
130.59.1.40

Japan anonymous FTP:

Kanagawash.wide.ad.jpX11R5
133.4.11.11
Kwansaiftp.ics.osaka-u.ac.jpX11R5
133.1.12.30
Kyushuwnoc-fuk.wide.ad.jpX11R5
133.4.14.3
TISNutsun.s.u-tokyo.ac.jpX11R5
133.11.11.11
Tokyokerr.iwanami.co.jpX11R5
133.235.128.1
Tokyoscslwide.sony.co.jppub/X11R5
133.138.199.1

UUCP:

uunetfor UUNET customers~/X/R5
decwrlexisting neighbors only~/pub/X11/R5
osu-cis~/X.V11R5
(not online until ~ 9 Sept)
WJanon(host: watjo.swp.wj.com)~/X/X11R5/
Modem: Telebit TB2500 (PEP, V.32, etc)
Systems or L.sys suggested/approximate entry:
WJanon Any ACU 19200 1-408-435-0240 "" \r login: WJanon
utaiexisting neighbors only~/ftp/pub/X11R5
hp4nlNetherlands only~uucp/pub/windows/X/R5



NFS:
Missouriwuarchive.wustl.edu/archive/packages/X11R5
128.252.135.4mount point: /archive

AFS:
Pennsylvania/afs/grand.central.org/pub/X11R5

NIFTP (hhcp, cpf, fcp, ...):
United Kingdomuk.ac.ic.doc.src
00000510200001
user "guest"

anon FTAM:
United Kingdom000005102000 (Janet)X.V11R5
146.169.3.7 (Internet)
204334504108 (IXI)

ACSNet:
Australiamunnari.oz (fetchfile)X.V11/R5
Please fetch only one file
at a time, after checking
that a copy is not available
at a closer site.

[9/2/91; updated for contrib 10/91]

Anyone in Europe can get a copy of the MIT X.V11R5 distribution, including
the core and contributed software and all official patches, free of charge.
The only requirement is to agree to return the tapes, or equivalent new tapes.
Only QIC and TK format cartridges can be provided. Contact: Jamie Watson,
Adasoft AG, Nesslerenweg 104, 3084 Wabern, Switzerland.
Tel: +41 31 961.35.70 or +41 62 61.41.21; Fax: +41 62 61.41.30; [email protected]

UK sites can obtain X11 through the UKUUG Software Distribution Service, from
the Department of Computing, Imperial College, London, in several tape formats.
You may also obtain the source via Janet (and therefore PSS) using Niftp (Host:
uk.ac.ic.doc.src Name: guest Password: your_email_address). Queries should be
directed to Lee McLoughlin, 071-589-5111#5037, or to [email protected]
or [email protected] (send a Subject line of "wanted". Also offered are
copies of comp.sources.x, the export.lcs.mit.edu contrib and doc areas and most
other announced freely distributable packages.

X11R5 and X11R4 source along with X11R5 contrib code, prebuilt X binaries for
major platforms, and source code examples from O'Reilly's books is available on
an ISO-9660-format CD-ROM from O'Reilly & Associates. [as of 3/92].

X11R5 source is available on ISO-9660-format CD-ROM for members of the Japan
Unix Society from Hiroaki Obata, [email protected]

X11R5 source along with GNU source, the comp.sources.x archives, and SPARC
binaries is available on an ISO-9660-format CD-ROM from PDQ Software,
510-947-5996 (or Robert A. Bruce, [email protected]).

X11R5 source is available from Automata Design Associates, +1 215-646-4894.

Various users' groups (e.g. SUG) offer X sources cheaply, typically on CD-ROM.

Source for the Andrew User Interface System 5.1 and binaries for common systems
are available on CD-ROM. Information: [email protected],
412-268-6710, fax 412-621-8081.

Binaries for X11R5, with shared libX11 and libXmu, for A/UX 2.0.1 are now
available from wuarchive.wustl.edu:/archive/systems/aux/X11R5. Patches for
X11R5 compiled with gcc (but not shared libraries) are also available.
[John L. Coolidge ([email protected], 10/91)]

Binaries by Rich Kaul ([email protected]) for the Sun386i running
SunOS 4.0.2 are available on dsinc.dsi.com (please only after-hours USA EST).

Binaries for the Sun386i are available from compaq.com (131.168.249.254) in
pub/sun-386i/sources and from vernam.cs.uwm.edu (129.89.9.117).

A binary tree for the Next by Douglas Scott ([email protected]) is on
foxtrot.ccmrc.ucsb.edu; it is missing the server, though.

Binaries for the Sun386i are in vernam.cs.uwm.edu:/sun386i.

Binaries for the HP-PA are on hpcvaaz.cv.hp.com (15.255.72.15).

Source and binaries for HP-UX 8.*/9.0(S300/400/700/800) and Domain 10.4 (68K,
DN 10K) are available through the Interworks Users Group; contact Carol Relph
at 508-436-5046, fax 508-256-7169, or [email protected]

Patches to X11R5 for Solaris 2.0 by Danny Backx ([email protected]) are on export in
contrib/X11r5-Solaris2-patches.tar.Z.

Patches to X11R5 for the Sun Type 5 keyboard and the keyboard NumLock are
available from William Bailey ([email protected]).


Also:

Binaries are available from Unipalm (+44 954 211797, [email protected]),
probably for the Sun platforms.

----------------------------------------------------------------------

David B. Lewis faq%[email protected]

"Just the FAQs, ma'am." -- Joe Friday
--
David B. LewisTemporarily at but not speaking for Visual, Inc.
day: [email protected]: david%[email protected]

From: [email protected] (David B. Lewis)
Newsgroups: comp.windows.x,news.answers,alt.answers,comp.answers
Subject: comp.windows.x Frequently Asked Questions (FAQ) 3/5
Summary: useful information about the X Window System
Reply-To: faq%[email protected] (X FAQ maintenance address)

Archive-name: x-faq/part3
Last-modified: 1993/02/06


----------------------------------------------------------------------
~Subject: 58)! Where can I get patches to X11R5?

The release of new public patches by the MIT X Consortium is announced
in the comp.windows.x.announce newsgroup.

Patches themselves are available via ftp from export and from other
sites from which X11 is available. They are now also distributed through the
newsgroup comp.sources.x. Some source re-sellers may be including patches in
their source distributions of X11.

People without ftp access can use the xstuff mail server. It now has
22 patches for X11R5 [2/93]. Send to [email protected] the Subject line
send fixes #
where # is the name of the patch and is usually just the number of the patch.

Here are a few complications:
1) fix 5 is in four parts; you need to request "5a", "5b", "5c" and
"5d" separately
2) the file sunGX.uu, which was part of an earlier patch, was
re-released with patch 7 [note: the file doesn't work with Solaris]
3) fix 8 is in two parts: "8a" and "8b"
4) fix 13 is in three parts: "13a", "13b", and "13c"
5) fix 16 is in two parts: "16a" and "16b"
6) fix 18 replaces the R5fix-test1 for the X Test Suite, which
previously was optional
7) fix 19 also needs PEXlib.tar.Z, which you can obtain from xstuff
by asking for "PEXlib.uu.[1234]".
8) fix 22 is in 9 parts, "22a" through "22i"

----------------------------------------------------------------------
~Subject: 59) What is the xstuff mail-archive?

The xstuff server is a mail-response program. That means that you mail
it a request, and it mails back the response.
Any of the four possible commands must be the first word on a line. The
xstuff server reads your entire message before it does anything, so you can
have several different commands in a single message (unless you ask for help).
The xstuff server treats the "Subject:" header line just like any other line
of the message.
The archives are organized into a series of directories and
subdirectories. Each directory has an index, and each subdirectory has an
index. The top-level index gives you an overview of what is in the
subdirectories, and the index for each subdirectory tells you what is in it.

1) The command "help" or "send help" causes the server to send you a
more detailed version of this help file.
2) if your message contains a line whose first word is "index", then
the server will send you the top-level index of the contents of the archive. If
there are other words on that line that match the name of subdirectories, then
the indexes for those subdirectories are sent instead of the top-level index.
For example, you can say "send index fixes" (or "index fixes"). A message that
requests an index cannot request data.
3) if your message contains a line whose first word is "send", then the
xstuff server will send you the item(s) named on the rest of the line. To name
an item, you give its directory and its name. For example
send fixes 1 4 8a 8b 9
You may issue multiple send requests. The xstuff server contains many
safeguards to ensure that it is not monopolized by people asking for large
amounts of data. The mailer is set up so that it will send no more than a fixed
amount of data each day. If the work queue contains more requests than the
day's quota, then the unsent files will not be processed until the next day.
Whenever the mailer is run to send its day's quota, it sends the requests out
shortest-first.
4) Some mailers produce mail headers that are unusable for extracting
return addresses. If you use such a mailer, you won't get any response. If
you happen to know an explicit path, you can include a line like
path foo%[email protected]
or
path bar!foo!frotz
in the body of your message, and the daemon will use it.

The xstuff server itself can be reached at [email protected] If
your mailer deals in "!" notation, try sending to
{someplace}!mit-eddie!expo.lcs.mit.edu!xstuff.

[based on information from the MIT X Consortium, 8/89, 4/90.]

----------------------------------------------------------------------
~Subject: 60) Where can I get X11R4 (source and binaries)?

Integrated Computer Solutions, Inc., ships X11R4 on half-inch,
quarter-inch, and TK50 formats. Call 617-621-0060 for ordering information.

The Free Software Foundation (617-876-3296) sells X11R4 on half-inch
tapes and on QIC-24 cartridges.

Yaser Doleh ([email protected]; P.O. Box 1301, Kent, OH 44240) is
making X11R4 available on HP format tapes, 16 track, and Sun cartridges. [2/90]

European sites can obtain a free X11R4 distribution from Jamie Watson,
who may be reached at chx400!pan!jw or [email protected] [10/90]

Non Standard Logics (+33 (1) 43 36 77 50; [email protected]) makes source
available.

IXI Limited (+44 223 462 131) is selling X11R4 source on quarter-inch
cartridge formats and on 5.25" and 3.5" floppy, with other formats available on
request. [IXI, 2/90]

Virtual Technologies (703-430-9247) provides the entire X11R4
compressed source release on a single QIC-24 quarter-inch cartridge and also on
1.2meg or 1.44 meg floppies upon request. [Conor Cahill
([email protected]) 2/90]

Young Minds (714-335-1350) makes the R4 and GNU distributions available
on a full-text-indexed CD-ROM.

[Note that some distributions are media-only and do not include docs.]

X11R4 is ftp-able from export.lcs.mit.edu; these sites are preferable,
though, and are more direct:

Machine Internet FTP
Location Name Address Directory
-------- ------- -------- -------------
(1) West USA gatekeeper.dec.com 16.1.0.2 pub/X11/R4
Central USA mordred.cs.purdue.edu 128.10.2.2 pub/X11/R4
(2) Central USA giza.cis.ohio-state.edu 128.146.8.61 pub/X.V11R4
Southeast USA uunet.uu.net 192.48.96.2 X/R4
(3) Northeast USA crl.dec.com 192.58.206.2 pub/X11/R4
(4) UK Janet src.doc.ic.ac.uk 129.31.81.36 X.V11R4
UK niftp uk.ac.ic.doc.src
(5) Australia munnari.oz.au 128.250.1.21 X.V11/R4

The giza.cis.ohio-state.edu site, in particular, is known to have much of the
contrib stuff that can be found on export.

The release is available to DEC Easynet sites as CRL::"/pub/X11/R4".

Sites in Australia may contact this address: ftp.Adelaide.EDU.AU [129.127.40.3]
and check the directory pub/X/R4. The machine shadows export and archives
comp.sources.x. (Mark Prior, [email protected], 5/90)

Note: a much more complete list is distributed regularly by Dan Heller
([email protected]) as part of the introductory postings to comp.sources.x.

A set of X11R4 binaries built by Tom Roell ([email protected])
for the 386/ix will available from export.lcs.mit.edu in /contrib and in
/pub/i386/X11R4 from 131.159.8.35 in Europe. Stephen Hite
([email protected]) can also distribute to folks without ftp facilities
via disks sent SASE; contact him for USmail and shipping details. [12/90] In
addition, the binaries are available via uucp from szebra [1-408-739-1520, TB+
(PEP); ogin:nuucp sword:nuucp] in /usr2/xbbs/bbs/x. In addition, the source is
on zok in /usrX/i386.R4server/. [2/91] In addition, if you are in the US, the
latest SVR4 binary (April 15), patches, and fonts are available on
piggy.ucsb.edu (128.111.72.50) in the directory /pub/X386, same filenames as
above. (Please use after 6pm Pacific, as these are large files.) [5/91]

A set of HP 9000/800 binaries is available on hpcvaaz.cv.hp.com (15.255.72.15)
as ~ftp/pub/MitX11R4/libs.x800.Z. [2/91]

A set of X11R4 binaries for the NeXT 2.x have been made available by Howie Kaye
on cunixf.cc.columbia.edu

A set of binaries by John Coolidge ([email protected]) for the Mac running
A/UX 2.0 is available from wuarchive.wustl.edu in the file
(/archive/systems/aux/X11R4/Xupdate2.tar.Z). Also in X11R4/diffs is a set of
patches for making X11R4 with shared libraries with mkshlib.

A complete distribution of SCO X11R4 binaries by Baruch Cochavy
([email protected]) can be found on uunet. The server is Roell's
X386 1.1b, compiled for ET4000 based SVGA boards.

----------------------------------------------------------------------
~Subject: 61)! Where can I get OSF/Motif?

You can obtain either OSF/Motif source or binaries from a number of
vendors.
Motif 1.2.1 source is now available; it is based on X11R5.
Motif 1.1 is based on the R4.18 Intrinsics and is currently [7/92] at
1.1.5.
An OSF/Motif source license must be obtained from OSF before source can
be obtained from the Open Software Foundation or any value-added vendor for
any version. Call the Direct Channels Desk at OSF at 617-621-7300 for ordering
information.
Various hardware vendors produce developer's toolkits of binaries,
header files, and documentation; check your hardware vendor, particularly if
that vendor is an OSF member.
In addition, independent binary vendors produce Motif toolkits for
machines for which Motif is not supported by a vendor; the kits include varied
levels of bug-fixing and support for shared libraries and are based on widely
divergent version of Motif:
Quest (408-988-8880) sells kits for Suns, as well;
IXI (+44 223 462 131) offers kits for Sun3 and Sun4.
NSL (+33 (1) 43 36 77 50; [email protected]) offers kits for the Sun 3
and Sun 4.
Bluestone Consulting makes a kit for Sun systems.
ICS (617-62-0060) makes several binary kits, notably for Sun, DEC.
HP and DEC have announced support for Motif on Sun systems.
Unipalm (+44-954-211-797) currently offers for Sun systems a Motif
Development Kit including X11R4 and based on Motif 1.1.2. The US distributor is
Expert Object Corp (708-926-8500).
BIM ships Motif 1.1 binaries for Suns. Shared library support is
included. Contact Alain Vermeiren ([email protected]) or Danny Backx ([email protected])
at +32(2)759.59.25 (Fax : +32(2)759.47.95) (Belgium).
SILOGIC (+33 61.57.95.95) ships Motif 1.2 and Motif 1.1 on Sun
machines.
S.I. Systems offers Motif 1.2 for Solaris 2.1; info: 1-800-755-8649 in
USA and Canada.
Metro Link Inc. (305-970-7353, [email protected]; in Europe contact
ADNT, (33 1) 3956 5333, UniVision (UK) Ltd. (44) 628 82 22 81) ships an
implementation of X11R4 and Motif 1.1.2 (including a shared-library
implementation of libXm.a) for the 386/486 Unix market. Motif 1.1.2 is
also available for Sun Sparc based workstations. It has also announced
Motif 1.2 for Solaris systems.

----------------------------------------------------------------------
~Subject: 62) Does Motif work with X11R4? X11R5?

Motif 1.2.* is based on X11R5.
Motif 1.1, available in source form from OSF as of August 1990, uses
the "vanilla" X11R4 Intrinsics, where "vanilla" means "with just a few
patches"; the file fix-osf which OSF distributes is obsoleted by MIT's patches
15-17. The file fix-osf-1.1.1 distributed with the 1.1.1 version or its
subsequent modification needs to be applied after MIT fix-18, though.

Motif 1.1.1 to 1.1.3 will work with X11R5 if X11R5 is compiled with
-DMOTIFBC; 1.1.4 and later should work with the vanilla R5, although there are
some known new geometry-management problems.

----------------------------------------------------------------------
~Subject: 63) Where can I get toolkits implementing OPEN LOOK?

Sun's XView has a SunView-style API. A version is on the X11R4 tape;
the latest [2/92] 3.0 sources are on export in contrib/xview3/.
XView and X binaries for the Sun 386i ("roadrunner") are available for
ftp from svin01.win.tue.nl (131.155.70.70), directory pub/X11R4_386i.
Supported binaries of XView 2.0 or 3.0 include:

XView for non-Sun Platforms (domestic and selected international vendors).
Several are also available from Sun; contact your local sales office.

AmigaGfxBase, Inc.1881 Ellwell Drive
(AmigaDOS)(408) 262-1469Milpitas, CA 95035
Fax: (408) 262-8276

SGI
Sony (NEWS-OS)
IBM RS/6000
HP 9000
DECstationUniPress Software2025 Lincoln Highway
(Ultrix)(908) 985-8000Edison, NJ 08817
Fax: (908) 287-4929

UniPress Software, Ltd.PO Box 70
44-624-661-8850Viking House
Fax: 44-624-663-453Nelson Street
Douglas, Isle of Man
United Kingdom

DEC VAXstationTGV603 Mission Street
(VMS)(800) TGV-3440Santa Cruz, CA 95060
(408) 427-4366
Fax: (408) 427-4365

Unipalm Ltd.145-147 St. Neots Road
44-0954-211797Hardwick
Fax: 44-0954-211244Cambridge CB3 7QJ
England

Intel 386Quarterdeck Office150 Pico Boulevard
(DOS)SystemsSanta Monica, CA 90405
(213) 392-9851
Fax: (213) 399-3802

Intel 386SunSoft Corporation6601 Center Drive West
(Interactive310-348-8649Suite 700
UNIX andLos Angeles, CA 90045
SCO UNIX)

StardentScripps InstituteClinic MB-5
(Stellix OSFax: (619) 554-448510666 N. Torrey Pines Road
and Titan OS)Include mailstop MB-5La Jolla, CA 92057
By ftp: 192.42.82.8 in pub/binary/{Xview.README,XView.tar.Z}

AT&T's OPEN LOOK GUI 3.0 Xt-based toolkit is now generally available
[2/92]; contact 1-800-828-UNIX#544 for information. Binaries are produced
for SPARC systems by International Quest Corporation (408-988-8289). A version
of the toolkit is also produced under the name OLIT by Sun.
More recent versions of OLIT have been ported to IBM 6000 and DEC MIPS
by both UniPress and ICS. OLIT is also available for HP from Melillo Consulting
(908-873-0075). MJM (Somerset, NJ) makes OLIT 4.0 for HP 7xx series running
HPUX 8.0, DECstations, and RS/6000s [thanks to Joanne Newbauer,
[email protected], 908-522-6677.]

Sun is shipping OpenWindows 3.0; contact your local sales
representative for more details; the package includes toolkit binaries and
header files.

ParcPlace's (formerly Solbourne's) extensible C++-based Object
Interface Library, which supports run-time selection between Open Look or
Motif, is available from 303-678-4626. [5/92]

----------------------------------------------------------------------
~Subject: 64)! Where can I get other X sources? (including R5 modifications)

The MIT Software Center ships the X Test Suite on tape.

A multi-threaded version of Xlib based on X11R5 patch 12 is now
available for anonymous FTP from (new version 1/93):
DEC on gatekeeper.dec.com (16.1.0.2) in /pub/X11/contrib/mt-xlib-1.1
MIT on export.lcs.mit.edu (18.24.0.12) in /contrib/mt-xlib-1.1

HP has made available drivers to permit the building of the X11R5
sample server on the HP 9000 Series 700 workstations; the files are on
export.lcs.mit.edu in ~ftp/contrib/R5.HP.SRV. [8/92]

User-contributed software is distributed through the newsgroup
comp.sources.x, moderated by David C. Martin ([email protected]); also check
that group for posting information.

Richard Hesketh ([email protected]) has been creating a list of freely-
available X sources. The list is stored on export.lcs.mit.edu in contrib as
x-source-list.Z. It lists the main storage locations for the program and
international sites from which it may be ftp'ed.

The machine export.lcs.mit.edu has a great deal of user-contributed
software in the contrib/ directory; a good deal of it is present in current or
earlier versions on the X11R3, X11R4, and X11R5 contrib tapes. There are also
directories for fixes to contrib software. The file on export in
contrib/00-index.txt is a quick overall index of the software in that area,
provided by Daniel Lewart ([email protected]).

These sites used to and may still mirror export and are of particular
use for Australasia: Anonymous ftp: ftp.Adelaide.EDU.AU; ACSnet Fetchfile:
sirius.ua.oz.

The material on giza.cis.ohio-state.edu, which tends to duplicate
the export archives, is also available via anonymous UUCP from osu-cis, at TB+
and V.32 speeds. Write to [email protected] (same as osu-cis!uucp) for
instructions. [the archive is now maintained by Karl Kleinpaste]

A new west-coast UUCP X11 Archive is administered by Mark Snitily
([email protected]) and contains the full X11 distribution, the XTEST
distribution, an entire archive of comp.sources.x and other goodies.
The machine zok has a TB+ modem which will connect to 19.2K, 2400,
1200 baud (in that order). The anonymous UUCP account is UXarch with password
Xgoodies. The modem's phone number is 408-996-8285.
A sample Systems (or L.sys) entry might be:
zok Any ACU 19200 4089968285 in:--in: UXarch word: Xgoodies
To get a current listing of the files that are available, download
the file "/usrX/ls-lR.Z".
A full subject index of the comp.sources.x files is available in the
file "/usrX/comp.sources.x/INDEX".
The machine has just the one modem, so please do not fetch large
amounts of data at one sitting.
[courtesy Mark Snitily, 2/90]

In addition, UUNET Source Archives (703-876-5050) tracks comp.sources.x and
provides 800MB+ of compressed programs on 6250 bpi tapes or 1/4" tapes. It
also mirrors export/contrib in its packages/X directory.

----------------------------------------------------------------------
~Subject: 65)! Where can I get interesting widgets?

The Free Widget Foundation (FWF) library sponsored by Brian Totty
([email protected]) is now [2/93] available on a.cs.uiuc.edu (128.174.252.1)
in pub/fwf.shar.Z. The set of widgets there is intended to form the basis for
future contributions. To be added to the discussion list,contact
[email protected] The current set includes a pixmap
editor. Version 3.4 is current; look for 4.0 in 4/93.
Peter Ware's Xo "Open Widget" set, which has Motif-like functionality,
is on archive.cis.ohio-state.edu as pub/Xo/Xo-2.1.tar.Z [8/92].
The AthenaTools Plotter Widget Set Version 6-beta [7/92] maintained by
Peter Klingebiel ([email protected]) includes many graph and plotting
widgets; a copy is on export in plotter.v6b.tar.Z, plotter.doc.tar.Z,
plotter.afm.tar.Z, and plotter.README. The latest versions may in fact be on
[email protected] (131.234.2.32) in /unix/tools.
An advance version of Marc Quinton's Motif port of the FWF MultiList
widget is in ftp.stna7.stna.dgac.fr:pub/MultiList.tar.Z [143.196.9.31].
Additional widgets are available on the contrib/ portion of the X11R4
tapes; these include the Xcu set.
Paul Johnston's ([email protected]) X Control Panel widget set
emulates hardware counterparts; sources are on export.lcs.mit.edu in
Xc-1.3.tar.Z.
O'Reilly Volume 4, Doug Young's book, the Asente/Swick book, and Jerry
Smith's "Object-oriented Programming with the X Window System Toolkits" all
include details on writing widgets and include several useful widgets; sources
are typically on export and/or UUNET.
The Dirt interface builder includes the libXukc widet set which extends
the functionality of Xaw.
A graph widget and other 2D-plot and 3D-contour widgets by Sundar
Narasimhan ([email protected]) are available from ftp.ai.mit.edu as
/com/ftp/pub/users/sundar/graph.tar.Z. The graph widget has been updated [3/91]
with documentation and histogram capabilities.
A graph widget is available from ftp.stna7.stna.dgac.fr in
pub/Graph.tar.Z; it uses a segment list for drawing and hence supports a zoom
operation.
Ken Lee's Xm widget (demo) that uses Display PostScript to draw labels
at a non-horizontal angle is on export in contrib/dpslabel.tar.Z.
The Table widget (works like troff TBL tables) is available in several
flavors, one of which is with the Widget Creation Library release.
Bell Communications Research has developed a Matrix widget for complex
application layouts; it's on export in contrib/Xbae-widgets-3.8.tar.Z [2/93.
The distribution also includes a "caption" widget to associate labels with
particular GUI components. (7/92)
Dan Connolly's ([email protected]) XcRichText interprets RTF data;
it's on export as contrib/XcRichText-1.1.tar.Z.
The XmGraph Motif-based graphing widget is on iworks.ecn.uiowa.edu in
/comp.hp/GUI_classic/XmGraph.tar.Z although it may not be stable.
A TeX-style Layout widget by Keith Packard is described in the
proceedings of the 7th MIT Technical Conference (O'Reilly X Resource volume 5);
source is available on export contrib/Layout.tar.Z.

A version of Lee Iverson's ([email protected]) image-viewing tool
is available as contrib/vimage-0.9.3.tar.Z on export.lcs.mit.edu. The package
also includes an ImageViewPort widget and a FileDialog widget. [12/91;5/92]
In addition, the PEXt toolkit by Rich Thomson ([email protected]) is
available on export as PEXt.tar.Z; it includes a PEX widget making it easier to
use PEX in Xt-based programs.
A Motif port of the Xaw clock widget is in ftp.stna7.stna.dgac.fr
in pub/Clock.tar.Z.
A modification of the Xaw ScrollBar widget which supports the arrowhead
style of other toolkits is on export in contrib/Xaw.Scrollbar.mta.Z.

A beta 0.3 (11/92) release of the R5 Xaw widgets with a 3D visual
appearance by Kaleb Keithley ([email protected]) is available on export
in contrib/Xaw3d/R5/Xaw3d-0.3.tar.Z. The library, which is binary-compatible
with the MIT Xaw, implements a 3D subclass which handles the extra drawing.

Also:
The Xtra XWidgets set includes widgets for pie and bar charts, XY
plots, Help, spreadsheets, data entry forms, and line and bar graphs. Contact
Graphical Software Technology at 310-328-9338 ([email protected]) for information.
The XRT/graph widget, available for Motif, XView and OLIT, displays
X-Y plots, bar and pie charts, and supports user-feedback, fast updates and
PostScript output. Contact KL Group Inc. at 416-594-1026 ([email protected]).
A set of data-entry widgets for Motif is available from Marlan
Software, 713-467-1458 ([email protected]).
A set of graph widgets is available from Expert Database Systems
(212-370-6700).
A set of OSF/Motif compound widgets and support routines for 2D
visualization is available from Ms Quek Lee Hian, National Computer Board,
Republic of Singapore; Tel : (65)7720435; Fax : (65)7795966;
Email : [email protected], [email protected]
The ICS Widget Databook includes a variety of control widgets and
special-purpose widgets, available on a variety of platforms. Information:
617-621-0060, [email protected]
Information on graphing tools may be obtained from [email protected]
(+1-510-848-0853, fax: +1-510-848-0854).

----------------------------------------------------------------------
~Subject: 66) Where can I get a good file-selector widget?

The Free Widget Foundation set offers a FileSelector widget, with
separate directory path and file listing windows, and the FileComplete, which
has emacs-style file completion and ~ expansion.
Other available file-requestor widgets include the XiFileSelector from
Iris Software's book, the xdbx file-selector extracted by David Nedde
([email protected]), and the FileNominator from the aXe distribution.
The GhostView, Xfig, and vimage packages also include file-selector
widgets.

----------------------------------------------------------------------
~Subject: 67) What widget is appropriate to use as a drawing canvas?

Some widget sets have a widget particularly for this purpose -- a
WorkSpace or DrawingArea which doesn't display anything but lets your Xt
application know when it has been re-exposed, resized, and when it has received
user key and mouse input.
The best thing to do for other widget sets -- including the Athena set
-- is to create or obtain such a widget; this is preferable to drawing into a
core widget and grabbing events with XtAddEventHandler(), which loses a number
of benefits of Xt and encapsulation of the functionality .
At least one version has been posted to comp.sources.x (name???).
The publicly-available programs xball and xpic include other versions.
The Athena Widget manual (mit/doc/Xaw/Template in the R5 distribution)
includes a tutorial and source code to a simple widget which is suitable for
use.
The Free Widget Foundation set contains a Canvas widget.

----------------------------------------------------------------------
~Subject: 68) What is the current state of the world in X terminals?

Jim Morton ([email protected]) posts quarterly to comp.windows.x a list of
manufacturers and terminals; it includes pricing information.

Notable buyers-guide surveys include:
- the September 1991 issue of Systems Intregration

----------------------------------------------------------------------
~Subject: 69) Where can I get an X server with a touchscreen or lightpen?

Labtam (+61 3 587 1444, fax +61 3 580 5581) offers a 19" Surface
Acoustic Wave touch-screen option on its Xengine terminals.
Tektronix (1-800-225-5434) provides an X terminal with the Xtouch
touch-screen. This terminal may also be resold through Trident Systems
(703-273-1012).
Metro Link (305-970-7353) supports the EloGraphics Serial Touch Screen
Controllers.

----------------------------------------------------------------------
~Subject: 70) Where can I get an X server on a PC (DOS or Unix)?

MIT X11R5 already provides a server to many 386/486 *Unixes* with
support for many of the popular video graphics adapters; and for other
non-MSDOS PCs you can obtain a server from these sources:

XFree86 (formerly X386 1.2E) is an enhanced version of X386 1.2, which
was distributed with X11R5; it includes many bug fixes, speed improvements, and
other enhancements. Source for version 1.1 [10/92] is on export.lcs.mit.edu in
pub/contrib, ftp.physics.su.oz.au in /X386, and ftp.win.tue.nl in /pub/X386. In
addition, binaries are on ftp.physics.su.oz.au, and ftp.win.tue.nl among other
systems. Info: [email protected]
Note: this package obsoletes Glenn Lai's Speedup patches for an
enhanced X11R5 server for 386 UNIXes with ET4000 boards (SpeedUp.tar.Z on
export).


Metro Link Inc. (305-970-7353, [email protected]; in Europe contact
ADNT, (33 1) 3956 5333) ships an implementation of X11R4 for the 386/486 Unix
market.

SGCS offers X386 Version 1.3, based on Thomas Roell's X11R5 two-headed
server, in binary and source form. Information: 408-255-9665, [email protected]

ISC, SCO, UHC, and other well-known operating-system vendors typically
offer X servers.

For MSDOS PCs:

Daniel J. McCoy ([email protected]) has started posting monthly a
list of non-UNIX servers for PCs, Macs, and Amigas; it includes pricing
information. The current copy is kept on export in contrib as
XServers-NonUNIX.txt.Z.

An article on PC X servers appears in the March 2, 1992 Open Systems Today.

Also of possible use:

Net-I from Programit (212-809-1707) enables communication among
DOS, OS/2 and Unix machines and can be used to display PC sessions on your
Unix X display.


----------------------------------------------------------------------
~Subject: 71) Where can I get an X server on a Macintosh running MacOS?

eXodus from White Pine Software (603-886-9050) runs on any Mac with
at least 1MB of memory and runs the X server within a standard Macintosh
window. Version 3.0 [6/91] supports intermixing of X and Mac windows and
the ADSP protocol. The version supports the SHAPE extension and includes
DECwindows support.

Apple's MacX runs on MacPlus or newer machines with >= 2MB of memory
and system software 6.0.4 or later. Version 1.1 is fully X11R4-based. It
supports full ICCCM-compatible cut and paste of text AND graphics between the
Macintosh and X11 worlds, the SHAPE extension (including SHAPEd windows on the
Macintosh desktop), an optional built-in ICCCM-compliant window manager, X11R4
fonts and colors, a built-in BDF font compiler, and built-in standard
colormaps. Upgrades to MacX are available by ftp from aux.support.apple.com.
Info: 408-996-1010.
[Note: MacX is also the name of a vax-mac xmodem transfer utility.]

Also:

Liken (1-800-245-UNIX or [email protected]) software enables monochrome
68000 Mac applications to run on a SPARC system running X.
Xport (1-800-245-UNIX (415-572-0200) or [email protected]) enables Mac
applications to display on an X-based workstation by turning the Mac into an X
client.
Intercon has a product called Planet-X which enables Mac applications
to display on an X server.

----------------------------------------------------------------------
~Subject: 72) Where can I get X for the Amiga?

The new Amiga 3000 machines offer an X server and OPEN LOOK tools and
libraries on a full SVR4 implementation.

GfxBase, Inc. provides "X11 R4.1" for the AmigaDos computer; it
contains X11R4 clients, fonts, etc., and a Release 4 color server. An optional
programmer's toolkit includes the header files, libraries, and sample programs.
Info from GfxBase, 408-262-1469. [Dale Luck
(uunet!{cbmvax|pyramid}!boing!dale); 2/91]

----------------------------------------------------------------------
~Subject: 73) Where can I get a fast X server for a workstation?

The R5 server should be among the fastest available for most machines.

International Quest Corporation (408-988-8289) has an optimized R4
server for Sun3/4 under SunOS 4.0.

Unipalm have R4 Servers for Sun3 and Sparc platforms. These are
optimised to use graphics hardware and will run with Sunview. Information:
+44 954 211797 or [email protected]

Xgraph's Xtool (408-492-9031) is an X server implemented in SunView
which boasts impressive results on Sun 3 and SPARC systems. [6/90]

Several companies are making hardware accellerator boards:

Dupont Pixel Systems (302-992-6911), for Sun.

Megatek's (619-455-5590) X-cellerator board for the Sun 3 and Sun 4 is
based on the TI 34020; the company claims performance improvements of 5x to
10x over the sample X11R3 server.

----------------------------------------------------------------------
~Subject: 74) Where can I get a server for my high-end Sun graphics board?

Takahashi Naoto (Electrotechnical Laboratory, [email protected]) has
modified the MIT X11R5 server to support the Sun CG8, CG9, and CG12 boards.
The files are on export in contrib/Xsun24-3.[01].tar.Z. Note that both files
are necessary to build Xsun24-3.1.

The JPL R5 Xsun Multi-screen server is a general purpose replacement
for the MIT server/ddx/sun layer; it provides for the screen to be split among
several monitors and implements several other features above the MIT
implementation. Available on export.lcs.mit.edu in the file
contrib/R5.Xsun.multi-screen.tar.Z. [Kaleb Keithley, [email protected],
12/91; the file was updated 22 Dec 1992.]

----------------------------------------------------------------------
~Subject: 75) Where can I get an "X terminal" server for my low-end Sun 3/50?

Seth Robertson ([email protected]) has written Xkernel; the current
version [1.4 as of 8/91, 2.0 expected RSN] is on sol.ctr.columbia.edu
[128.59.64.40] in /pub/Xkernel.gamma. It turns a Sun 3/50 into a pseudo- X
terminal; most of the overhead of the operating system is side-stepped, so it
is fairly fast and needs little disk space.
A similar approach is to run the regular X server by making /etc/init
a shell script which does the minimal setup and then invokes Xsun, like this
example script from [email protected]:

#! /bin/sh
exec >/dev/console 2>&1
/etc/fsck -p /dev/nd0
case $? in
0);;
4)/etc/reboot -q -n
;;
8)echo ND fsck failed - get help
/etc/halt
;;
12)echo Interrupted
/etc/reboot
;;
*)echo Unknown error in reboot fsck - get help
/etc/halt
;;
esac
/bin/dd if=/tmp-fs of=/dev/nd2 bs=512 count=128 >/dev/null 2>&1
/etc/mount /dev/nd2 /tmp
/etc/ifconfig le0 netmask 255.255.255.0 broadcast 132.206.41.255
/etc/mount -o ro apollo:/u2/x11/lib /local/lib/X11
/etc/route add default 132.206.41.1 1 >/dev/null
set `/etc/ifconfig le0`
exec /Xsun -once -multidisp -mux -query \
`(sh -vn &1)`

----------------------------------------------------------------------
~Subject: 76)! What terminal emulators other than xterm are available?

PCS has rewritten xterm from scratch using a multi-widget approach that
can be used by applications. A version is on the R5 contrib tape and on
export in contrib/emu.tar.Z [10/91]. For more information, contact
[email protected]

mxterm, a Motif-based xterm is available from the Paderborner
ftp-Server [email protected] (131.234.2.32), file
/unix/X11/more_contrib/mxterm.tar.Z.

The Color Terminal Widget provides ANSI-terminal emulation compatible
with the VTx00 series; a version is on export in contrib/CTW-1.1.tar.Z. A
Motif version is on ftp.stna7.stna.dgac.fr in pub/Term-1.0.tar.Z.

kterm 4.1.2 is an X11R4-based vt100/vt102 (and Tektronix 4014) terminal
emulator that supports display of Chinese, Japanese, and Korean text (in VT
mode). Also supported are: ANSI color sequences, multi-byte word selection,
limited Compound Text support, and tab and newline preservation in selections.
kterm 4.1.2 is also available from these anonymous ftp sites:
clr.nmsu.edu:pub/misc/kterm-4.1.2.tar.Z [128.123.1.14]
export.lcs.mit.edu:contrib/kterm-4.1.2.tar.Z [18.24.0.12]
kum.kaist.ac.kr:pub/unix/Xstuffs/kterm-4.1.2.tar.Z [137.68.1.65]
[courtesy of Mark Leisher ]
kterm-5.1.0.tar.Z is now on export [7/92].

mterm, by [email protected], is an X terminal emulator
which includes ANSI X3.64 and DEC emulation modes. mterm can be had by ftp to
larry.mcrcim.mcgill.edu (132.206.1.1), in X/mterm.src/mterm.ball-o-wax.

Cxterm is a Chinese xterm, which supports both GB2312-1980 and the
so-called Big-5 encoding. Hanzi input conversion mechanism is builtin in
cxterm. Most input methods are stored in external files that are loaded at run
time. Users can redefine any existing input methods or create their own ones.
The X11R5 cxterm is the rewritten of cxterm (version 11.5.1) based on X11R5
xterm; it is in the R5 contrib software. [thanks to Zhou Ning
and Steinar Bang .]

XVT is available on export's contrib in xvt-1.0.tar.Z and
xvt-1.0.README. It is designed to offer xterm's functionality with lower swap
space and may be of particular use on systems driving many X terminals.

x3270 is in X11R5 contrib/.

Also:
IBM sells a 3270 emulator for the RS/6000 (part #5765-011); it's based
on Motif.

Century Software (801-268-3088) sells a VT220 terminal emulator for X.
VT102, Wyse 50 and SCO Color Console emulation are also available.

Grafpoint's TGRAF-X provides emulation of Tektronix 4107, 4125, and
42xx graphics terminals; it's available for most major platforms. Information
(inc. free demo copies): 800-426-2230; Fax. 408-446-0666; uunet!grafpnt!sales.

IXI's X.deskterm, a package for integrating character-based
applications into an X environment, includes a number of terminal-emulation
modules. Information: +44 (0223) 462131. [5/90]

Pericom produces Teem-X, a set of several emulation packages for a
number of Tek, DEC, Westward, and Data General terminals. The software runs on
Sun 3, Sun 4, Apollo, DEC, ISC, IBM/AIX. Information: US: 609-895-0404,
UK: +44 (0908) 560022. [5/90]

SCO's SCOterm ([email protected]), part of its Open Desktop environment, is
a Motif-compliant SCO ANSI color console emulator.

----------------------------------------------------------------------
~Subject: 77)! Where can I get an X-based editor or word-processor?

You can ftp a version of GNU Emacs, the extensible, customizable,
self-documenting, real-time display editor, including X11 support, from
prep.ai.mit.edu [18.71.0.38]:/pub/gnu/emacs-18.58.tar.Z or
informatik.tu-muenchen.de:/pub/GNU/emacs/emacs-18.58.tar.Z.

Epoch is a modified version of Gnu Emacs with additional facilities
useful in an X environment. Current sources are on cs.uiuc.edu (128.174.252.1)
in ~ftp/pub/epoch-files/epoch; the current [3/92] version is 4.0.
[In Europe, try unido.informatik.uni-dortmund.de]. There are two
subdirectories: epoch contains the epoch source, and gwm contains the source
to the programmable window manager GWM, with which epoch works well.]
You can get on the Epoch mailing list by sending a request to
[email protected]

The Andrew system on the X11 contrib tapes has been described as one of
the best word-processing packages available. It supports word processing with
multi-media embedded objects: rasters, tables/spread sheets, drawings, style
editor, application builder, embedded programming language, &c. Release 5.1
became available 2 June 92. [Fred Hansen ([email protected])]
You may be able to use the Remote Andrew Demo service to try this
software; try "finger [email protected]" for help.

The InterViews C++ toolkit contains a WYSIWIG editor called Doc; it
saves and loads files in a LaTeX-*like* format (not quite LaTeX). The package
can also import idraw-PostScript drawings.

A simple editor aXe (by [email protected]) is available on
export as aXe-3.1.tar.Z [9/92]. It is based around the Xaw Text widget.

TED is a simple Motif-based text editor; it is a wrapper around the
Motif text widget which offers search/replace, paragraph formatting, and
navigation features. TED is available from ftp.eos.ncsu.edu (152.1.9.25) as
/pub/bill.tar.Z; here are also executables there.

Point, by [email protected] (Charlie Crowley), is Tcl/Tk-based
and offers dyanimic configuration and programming in the Tcl macro language.
The editor is available from unmvax.cs.unm.edu (129.24.16.1) as
pub/Point/point1.1-tar.Z.

asedit is on export in contrib/asedit.tar.Z. It is a simple text editor
built around the Motif Text widget. [12/92]

Also:

Elan Computer Group (Mountain View, CA; 415-964-2200) has announced the
Avalon Publisher 2.0, an X11/OPEN LOOK WYSIWYG electronic publishing system.

FrameMaker and FrameWriter are available as X-based binary products for
several machines. Frame is at 800-843-7263 (CA: 408-433-3311).

WX2 (formerly InDepthEdit) is available from Non Standard Logics
(+33 (1) 43 36 77 50; [email protected]).

Buzzwords International Inc. has an editor called 'Professional Edit'
that runs under X/Motif for various platforms. Info: +1-314-334-6317.

DECwrite is available from DEC for some DEC hardware and SunWrite is
available from Sun.

IslandWrite will soon be available from Island Graphics (415-491-1000)
([email protected]) for some HP & Apollo platforms.

Interleaf is currently available from Interleaf (800-241-7700,
MA: 617-577-9800) on all Sun and DEC platforms; others are under development.

The Aster*x office integration tools from Applix (1-800-8APPLIX,
MA: 508-870-0300) include a multi-font WYSIWG document composer; for several
systems.

ArborText, Inc. provides an X11 version of its Electronic Publishing
program called "The Publisher". The Publisher is available on Sun, HP and
Apollo workstations. Contact Arbortext at 313-996-3566. [5/90]

Iris Computing Laboratories offers the "ie" editor. Info:
+1-505-988-2670 or [email protected]

BBN/Slate from BBN Software Products includes a menu-driven word
processor with multiple fonts and style sheets. It supports X on
multiple platforms. (617-873-5000 or [email protected]) [11/90]

The powerful "sam" editor by Rob Pike is split into a host portion and
a front-end graphics portion, which now has an X implementation. sam is now
available by anonymous ftp from research.att.com, in dist/sam/bundle.Z. Watch
that space for updated versions. There is a mailing list for sam users;
requests to . A set of extensions
which augment the mouse activity with the keyboard is available from
uxc.cso.uiuc.edu in pub/sam/samx1.0.shar.

Innovative Solutions (505-883-4252; or Brian Zimbelman,
[email protected]) publishes the user-configurable Motif-based Xamine
editor.

Qualix offers a product. Information: [email protected] or 800-245-UNIX
(415-572-0200).

Typex is a Motif-based editor available for several systems.
Information: Amcad Research, 408-867-5705, fax -6209.

WordPerfect offers an X-based version of WordPerfect 5.1 for several
workstations. Information: 801-222-5300 or 800-451-5151.

----------------------------------------------------------------------
~Subject: 78) Where can I get an X-based mailer?

xmh, an X interface to mh, is distributed with the X11 release.

Xmail is an X-based window interface to Berkeley-style mail handlers;
it is styled primarily after the Sunview mailtool application and builds on
most Unix systems. The current release [1/92] is 1.4, available in the MIT
X11R5 contrib tape and from export and uunet. Info: Jeff Markham,
[email protected]

MMH (My Mail Handler), a motif interface to the MH mail handler, is
available from ftp.eos.ncsu.edu (152.1.9.25) in pub/bill.tar.Z; it is bundled
with the TED editor, which it uses for composing messages. Motif 1.1 is
required; if you don't have it, look for DEC and SPARC executables in the same
place. Information and problems to: Erik Scott, [email protected] [1/92]

The Andrew Toolkit supports the Andrew Message System; it is available
from export and many other X archives and from emsworth.andrew.cmu.edu
(128.2.30.62), or send email to [email protected] Release 5.1 became
available 2 June 92.
You may be able to use the Remote Andrew Demo service to try this
software; try "finger [email protected]" for help.

XMailTool is an Xaw-based interface to a BSD-style mail reader; version
2.0 was released 9/92. Information: Bob Kierski, [email protected] or 612-683-5874.

Cem is a Motif-based mailer using standard mailbox formats; it is on
nelson.tx.ncsu.edu in pub/Cem. Information: Sam Moore ([email protected]).

Also:

Alfalfa Software offers Poste, a UNIX-based mailer that has Motif- and
command-based interfaces. It includes support for multimedia enclosures, and
supports both the Internet and X.400 mail standards. Information:
[email protected], +1 617-497-2922.

Z-Code Software offers Z-Mail for most Unix systems; binaries support
both tty and Motif interfaces. The mailer includes a csh-like scripting
language for customizing and extending mail capabilities. Information:
[email protected], +1 415 499-8649.

Several vendors' systems include X-based mailers. DEC offers dxmail;
Sun offers an X-based mailtool; SCO ([email protected]) includes SCOmail in its Open
Desktop product.

Several integrated office-productivity tools include mailers:

The Aster*x office integration tools from Applix (1-800-8APPLIX,
MA: 508-870-0300) include a mailer.

----------------------------------------------------------------------
~Subject: 79)! Where can I get an X-based paint/draw program?

xpic is an object-oriented drawing program. It supports multiple font
styles and sizes and variable line widths; there are no rotations or zooms.
xpic is quite suitable as an interactive front-end to pic, though the
xpic-format produced can be converted into PostScript. (The latest version is
on the R4 contrib tape in clients/xpic.)

xfig (by Brian V. Smith ([email protected])) is an object-oriented
drawing program supporting compound objects. The xfig format can be converted
to PostScript or other formats. Recent versions are on the R5 contrib tape or
on export in /contrib/R5fixes (version 2.1.6 [11/92]).

idraw supports numerous fonts and various line styles and arbitrary
rotations. It supports zoom and scroll and color draws and fills. The file
format is a PostScript dialect. It can import TIFF files. Distributed as a part
of the InterViews C++ toolkit (current release 3.1, from
interviews.stanford.edu) .

An alpha of Robert Forsman's ([email protected]) xscribble,
an 8-bit paint program for X, is now on ftp.cis.ufl.edu in pub/empire/. [7/92]

xpaint is available from ftp.ee.lbl.gov as xpaint.tar.Z.
A rewrite, Xpaint 2.0, by David Koblas ([email protected]) was released
1/93 as xpaint2pl2.tar.Z. xpaint is a bitmap/pixmap editing tool.

A new OpenWindows PostScript-based graphical editor named 'ice' is now
[2/91] available for anonymous ftp from Internet host lamont.ldgo.columbia.edu
(129.236.10.30). ice (Image Composition Environment) is an imaging tool that
allows raster images to be combined with a wide variety of PostScript
annotations in WYSIWYG fashion via X11 imaging routines and NeWS PostScript
rasterizing. (It may require OpenWindows and Sun C++ 2.0.)

tgif by William Cheng ([email protected]) is available from most
uucp sites and also from export and from cs.ucla.edu. It is frequently updated;
version 2.12-patch16 was released 1/93.

The "pixmap" program (info: [email protected]) for creating pixmaps is
on the R5 contrib tape; it resembles the bitmap client. Version 2.1 is now
available. [11/92]

Although MetaCard is not generally classified as a paint program, a
full 24-bit color image editor is built into the program, which can be used for
light image editing and for producing color icons ([email protected]). MetaCard
is available via anonymous FTP from ftp.metacard.com, csn.org, or
128.138.213.21.

Also:

dxpaint is a bitmap-oriented drawing program most like MacPaint; it's
good for use by artists but commonly held to be bad for drawing figures or
drafting. dxpaint is part of DEC's Ultrix release.

FrameMaker has some draw capabilities. [4/90]

BBN/Slate from BBN Software Products includes a full-featured draw and
paint program with object grouping and multiple patterns; multiple X platforms.
(617-873-5000 or [email protected]). [11/90]

Dux Ta-Dah!, 1-800-543-4999

IslandGraphics offers IslandDraw, IslandPaint, IslandPresent.
Info: 415-491-1000.

Corel Draw, 613-728-8200; ported to X by Prior Data Sciences
800-267-2626

Arts&Letters Composer, 214-661-8960

Ficor AutoGraph, 513-771-4466

Several integrated office-productivity tools include draw/paint capabilities:

The Aster*x office integration tools from Applix (1-800-8APPLIX,
MA: 508-870-0300) include draw/paint capabilities.

[thanks in part to Stephen J. Byers ([email protected])]

----------------------------------------------------------------------

David B. Lewis faq%[email protected]

"Just the FAQs, ma'am." -- Joe Friday
--
David B. LewisTemporarily at but not speaking for Visual, Inc.
day: [email protected]: david%[email protected]

From: [email protected] (David B. Lewis)
Newsgroups: comp.windows.x,news.answers,alt.answers,comp.answers
Subject: comp.windows.x Frequently Asked Questions (FAQ) 4/5
Summary: useful information about the X Window System
Date: 8 Feb 93 14:39:24 GMT
Reply-To: faq%[email protected] (X FAQ maintenance address)

Archive-name: x-faq/part4
Last-modified: 1993/02/06


----------------------------------------------------------------------
~Subject: 80) Where can I get an X-based plotting program?

These usually are available from uucp sites such as uunet or other sites as
marked; please consult the archie server to find more recent versions.

gnuplotX (xplot), PostScript and a bunch of other drivers.
export.lcs.mit.edu [and elsewhere]:contrib/gnuplot3.1.tar.Z

gl_plotX output only [?]
comp.sources.unix/volume18

graph+
yallara.cs.rmit.oz.au:/pub/graph+.tar.Z [131.170.24.42]
comp.sources.unix/volume8

pdraw,drawplot2D and 3D X,PS
scam.berkeley.edu:/src/local/3dplot.tar.Z [128.32.138.1]
scam.berkeley.edu:/src/local/contour.tar.Z [128.32.138.1]
scam.berkeley.edu:/src/local/drawplot.tar.Z [128.32.138.1]
uunet:~ftp/contrib/drawplot.tar.Z

xgraphplot, zoom. Outputs PS or HPGL.
shambhala.berkeley.edu:/pub/xgraph-11.tar.Z [128.32.132.54]
sun1.ruf.uni-freiburg.de:X11/contrib/xgraph-11.tar.Z [132.230.1.1]
nisc.jvnc.net:pub/xgraph-11.tar.Z [128.121.50.7]
comp.sources.x/volume3
or many other sites

ACE/gr (formerly xvgr and xmgr) XY plotting tools
ftp.ccalmr.ogi.edu [129.95.72.34]
XView version: /CCALMR/pub/acegr/xvgr-2.09.tar.Z
Motif version: /CCALMR/pub/acegr/xmgr-2.09.tar.Z

XGobiAn interactive dynamic scatter-plotting tool from Bellcore
lib.stat.cmu.edu: general/xgobi* [log in as statlib with your email
as the password]
Information from: Debby Swayne, [email protected]

Robota scientific XView-based graph plotting and data analysis tool
ftp.astro.psu.edu:pub/astrod/robotx0.44.tar.Z [128.118.147.28]


[2/91. Thanks in part to: [email protected] (Ed Vielmetti); [email protected]
(Geoffrey Leach); Paul A. Scowen ([email protected]); [email protected]
(Mike Black)]

----------------------------------------------------------------------
~Subject: 81)! Where can I get an X-based spreadsheet?

A version of "sc" for X and which supports Lotus files is available from
vernam.cs.uwm.edu in xspread2.0.tar.Z. It also includes graphing functions.
Information: [email protected]

The GNU package OLEO is available in prep.ai.mit.edu:pub/gnu/oleo-1.2.2.tar.Z;
it can generate PostScript renditions of spreadsheets.

Also:

Several of the below are part of integrated office-productivity tools which may
also include word-processing, email, conferencing, image processing, and
drawing/painting, among other features.

Vendor Product Contact Information
------ ------- -------------------
Access Technology 20/20 508-655-9191
Informix WingZ 800-331-1763
Quality Software Products Q-Calc/eXclaim 800-628-3999 (CA:213-410-0303)
Unipress Q-Calc 201-985-8000
Uniplex Uniplex 214-717-0068, 800-356-8063
Digital DECdecision 1-800-DIGITAL
Applix Aster*x 508-870-0300, 1-800-8APPLIX.
AIS XESS 919-942-7801, [email protected]
BBN Software Products BBN/Slate 617-873-5000 [email protected]
Elsid Software Systems Ripcam 613-228-9468

SAS by the SAS Institute now has a spreadsheet module; the X version is
available on the current popular RISC platforms.

----------------------------------------------------------------------
~Subject: 82) Where can I get X-based project-management software?

Vendor ProductContact Information
--------------------------------
Productivity SolutionsUltra Planner617-237-1600
Quality Software Products MasterPlan Version, 310-410-0303 [email protected]
Digital Tools, Inc.AutoPLAN408-366-6920, 800-755-0065
NASACOMPASS404-542-3265,
[email protected]
GEC-Marconi Software SystemsGECOMO Plus703-648-1551
GEC-Marconi Software SystemsSIZE Plus703-648-1551
TEI, IncVUE408-985-7100
MantixCascade703-506-8833
Advanced Management SolutionsSchedule Publisher800-397-6829
Auburn University????

[thanks to Pete Phillips ([email protected]); 7/92]
[thanks to Atul Chhabra ([email protected]); 10/92]

----------------------------------------------------------------------
~Subject: 83) Where can I get an X-based PostScript previewer?

Ghostscript is distributed by the Free Software Foundation
(617-876-3296) and includes a PostScript interpreter and a library of graphics
primitives. Version 2.5.2 is now available; the major site is prep.ai.mit.edu.
[11/92]

GSPreview (by the Computing Laboratory of the University of Kent at
Canterbury) is an X user interface (WCL-based) to the Ghostscript 2.4[.1]
interpreter [5/92]. The source is available for anonymous ftp from
export.lcs.mit.edu as gspreview.2.0.tar.Z.

Ghostview (by Tim Theisen, [email protected]) is full-function user
interface for GhostScript. Check ftp.cs.wisc.edu or prep.ai.mit.edu for
/pub/ghostview-1.4.1.tar.Z [1/93]. There are also several executables available
on ftp.cs.wisc.edu:/pub/X/ghostview-exe for various architectures.

Also:

ScriptWorks is Harlequin's software package for previewing and printing
PostScript(R) descriptions of text and graphics images; previewers for X are
available. For information call +44-223-872522 or send email to
[email protected]

Image Network's Xps supports the full PostScript language and renders
in color, grayscale, or monochrome. Fonts displayed are anti-aliased. Info:
Image Network, +1 415 967 0542.

Digital's dxpsview runs on UWS 2.1 and 2.2.

Sun's pageview runs with the X11/NeWS server.

----------------------------------------------------------------------
~Subject: 84) Where can I get an X-based GKS package?

The latest freely-available XGKS can be obtained from
[email protected]; this is a 2c implementation derived from the
X11R4 contrib XGKS from IBM and the University of Illinois. The release
is on unidata.ucar.edu [128.117.140.3] as pub/xgks.tar.Z. [12/90]
In addition, Grafpak-GKS is available from Advanced Technology Center
(714-583-9119).
GKSUL is available from [email protected] (ULowell CS department). It is
a 2b implementation which includes drivers for a variety of devices. It can be
passed an X window ID to use. The package includes both C and Fortran bindings.

[11/90; from [email protected] and from [email protected]]

An XgksWidget is produced by Neil Bowers ([email protected];
[email protected]); the latest [10/91] conforms with the new version of
XGKS (2.4). It is available on export in contrib/xgks-widget.tar.Z.

----------------------------------------------------------------------
~Subject: 85)! Where can I get an X-based PEX package?

The first official release of PEX is with X11R5; fix-22 brings the
Sample Implementation server to version 5.1.

The final PEX 5.1 Protocol specification is now available via anonymous
ftp to export.lcs.mit.edu (18.24.0.12), in the directory /pub/DOCS/PEX/.
Changes made from the Public Review draft are listed in the file "5.1P_changes"
in that directory. [9/92]

The final PEXlib 5.1 document is on export in pub/DOCS/PEXlib. [11/92]

There is now available from the University of Illinois an
implementation of the PEX 4.0 specification called UIPEX. It contains a "near-
complete" implementation of PHiGS and PHiGS PLUS. The file
pub/uipex/uipex.tar.Z is on a.cs.uiuc.edu (128.174.252.1); the porting platform
was an RT running 4.3. Questions and comments can to go [email protected]

In addition, the PEXt toolkit by Rich Thomson ([email protected]) is
available on export as PEXt.tar.Z; it includes a PEX widget making it easier to
include PEX in Xt-based programs.

----------------------------------------------------------------------
~Subject: 86) Where can I get an X-based TeX or DVI previewer?

The xtex previewer for TeX files is available from a number of archive
sites, including uunet; the current version is usually on ftp.cs.colorado.edu
(128.138.204.31) in SeeTeX-2.18.5.tar.Z; pre-converted fonts are also on that
machine. The distribution all includes "mftobdf" which converts PK, GF, and PXL
fonts to BDF format, where they can then be compiled for use by your local X
server.
The xdvi dvi-previewer is fairly comprehensive and easy to use. It is
also available from a number of sites, including uunet and export.lcs.mit.edu;
current version is patchlevel 16 [12/92].

----------------------------------------------------------------------
~Subject: 87) Where can I get an X-based troff previewer?

X11R4 has two previewers for device-independent troff: the supported
client xditview, and the contributed-but-well-maintained xtroff. An earlier
version of xtroff also appeared on the R3 contributed source. xditview is also
in the R5 distribution.
In addition, the xman client can be used to preview troff documents
which use the -man macros (i.e. man pages).
If psroff is used its output can be viewed with a PostScript previewer.

In addition:

xproof, an X previewer for ditroff has been contributed by Marvin
Solomon ([email protected]); version 3.5 is available on export in
contrib/xproof*. [8/90]

Elan Computer Group (CA: 415-964-2200) produces eroff, a modified
troff implementation, and Elan/Express, an X11 eroff previewer.

SoftQuad (416-963-8337; USA only 800-387-2777, [email protected] or
[email protected]) offers SoftQuad Publishing Software, including a substantially-
rewritten troff formatter, a better intermediate language with backwards
compatibility, and an X11[R3,R4] previewer. (This is the package adopted by
AT&T's own MIS department, and used in and re-sold by many parts of AT&T).
[information from Ian Darwin, SoftQuad ([email protected]) 3/90]

Image Network (1-800-TOXROFF; CA: 415-967-0542) offers the Xroff
package, which includes a fine modified troff implementation and a set of
X11-based page previewers. (This is the package OEM'ed by several hardware
vendors.)

[mostly courtesy [email protected] (Mark Moraes)] [2/90]

----------------------------------------------------------------------
~Subject: 88)! Where can I get a WYSIWYG interface builder?

A new release of the DIRT interface builder by Richard Hesketh works
with X11R5 and includes some support for the Motif widget set. From the README:
This builder allows the interactive creation and rapid prototyping of X user
interfaces using the X Toolkit and a number of Widget Sets. Dirt generates
"Wc - Widget Creation" resource files and this distribution also includes the
Widget Creation Library (version 1.06, with the exception of the demos and
Mri/Ari source code) with the kind permission of its author David E. Smyth.
Check dirt.README, dirt.A2.0.tar.Z, and dirt.PS.Z on export.lcs.mit.edu.

The InterViews 3.0.1 C++ toolkit contains a WYSIWIG interface builder
called ibuild. ibuild generates code for an InterViews application complete
with Imakefile and an X-resource file. Documentation is /pub/papers/ibuild.ps
on interviews.stanford.edu (36.22.0.175).
Quest Windows's (408-496-1900) ObjectViews C++ package includes an
interactive building tool.

Druid (Demonstrational Rapid User Interface Development) runs on SPARC
machines using OSF/Motif 1.0; it is intended eventually to be a full UIMS but
apparently now has only support for creating the presentation components, for
which it generates C/UIL code. Info: Singh G, Kok CH, Ngan TY, "Druid: A System
for Demonstrational Rapid User Interface Development". Proc. ACM SIGGRAPH Symp
on User Interface Software and Technology (UIST'90). ACM, NY, 1990, pp:167-177.

The BYO interface builder is implemented in tcl.

Also:
In addition, these commercial products (unsorted) are available in
final or prerelease form [the * following the product name indicates that the
product is known to allow the designer to specify for each widget whether a
particular resource is hard-coded or written to an application defaults file,
for at least one form of output]. Some are much more than user-interface tools;
some are full user interface management systems; information on most is not
up-to-date:

Product NameLook/FeelCode OutputVendor

HP InterfaceMotif 1.1C(Xm)HP/Visual Edge
Architect/ UIMX
OPEN LOOK ExpressOPEN LOOKC(Xol+ helper lib)AT&T /
Visual Edge
UIMX 2.0 *Motif 1.1C(Xm + helper code)Visual Edge
514-332-6430
& distributors
VUIT 2.0Motif 1.1C/UIL[r/w]DEC
(1-800-DIGITAL)
X-Designer 1.1 *Motif 1.1C(Xm); C/UILImperial
Software
Technology, Ltd
(+44 734 587055)
[email protected]
XFaceMaker2 (XFM2) * Motif 1.0C;C/script (C-like procedural
language);C/UIL
NSL
(33 1 43 36 77 50)
[email protected]
Builder Xcessory 2.0 *Motif 1.1C(Xm); C/UIL[r/w]ICS
Ada(617-621-0060)
[email protected]
XBUILD 1.1 *Motif 1.0C(Xm); C/UIL Nixdorf
(617-864-0066)
[email protected]
iXBUILDMotif 1.1C(Xm); C/UILiXOS Software
[email protected]
089/461005-69
TeleUSE 2.1 *Motif 1.1.5C(Xm); C/UIL[r/w]
Telesoft
(619-457-2700)
[email protected]
ezX 3.2Motif 1.1C(Xm +helper lib);C/UIL;Ada
Sunrise
(401-847-7868)
[email protected]
SnapixMotifC/XmADNT
+33 1 3956 5333
OpenWindows DevelopersOPEN LOOK GIL [-> C/XView]Sun
Guide 3.0GIL [-> C++/XView]
GIL [-> C/OLIT]
GIL [-> C/PostScript for TNT]
ExoCode/SXMMotifC(Xm)Expert Object
ExoCode/PlusOPEN LOOKXView708-676-5555
TAE+Xw;MotifC(Xw,Xm); C/TCL (TAE Control Language,
like UIL[needs helper library]);
VAX Fortran; Ada; C++
Nasa Goddard
(301) 286-6034
MOB, XSculptorMotif; OpenLookC/Xm,UIL; C/XolKovi
408-982-3840
PSMPM, MSW 3.0,C/UILLancorp
Motif 1.1.2,MacPty Ltd.
+61 3 629 4833
Fax: 629 1296
(Australia)
MOTIFATIONMotif 1.0|1.1.2C(Xm)AKA EDV
+49 (0) 234/33397-0
+49 (0) 234/33397-40 fax
UIBOpen Look/MotifC++(OI)ParcPlace
+1 303-678-4626

Look for magazine reviews for more complete comparisons of meta-file formats,
documentation, real ease-of-use, etc; Unix World and Unix Review often carry
articles.

In addition, Neuron Data (1 415 321-4488) makes Open Interface, a
window-system-independent object toolkit which supports interfaces which are
or resemble (supersets of) Mac, Windows, and Motif and Open Look; the package
includes an interface builder.

In addition, the GRAMMI builder supports the development of Ada/X
applications using its own set of objects which are planned to have a Motif
look. GRAMMI is written in Ada and generates Ada specs and stub bodies.
(1-800-GRAMMI-1).

In addition, these non-WYSIWYG but related products may help for goals
of rapid prototyping of the application interface:

WCL: the Widget Creation Library. Basically describes the widget
hierarchy and actions in a resources file; available from fine archive servers
everywhere, including devvax.jpl.nasa.gov (128.149.1.143) in pub/. Wcl provides
a very thin layer over Xt without any internal tweaking. Version 2.4 is current
[2/93].
WINTERP: an Xlisp-based Motif toolkit allows for interpretive
programming. The copy on the R4 tape is outdated; get a copy off export or
email to winterp-source%[email protected]
The Serpent UIMS permits the building of user-interfaces without
specific knowledge of coding but with an understanding of attributes being set
on a particular [Motif] widget. Beta Release 1.2 is available from
ftp.sei.cmu.edu (128.237.1.13) and can be found in /pub/serpent. Serpent is
also available on export.lcs.mit.edu (18.24.0.11) in /contrib/serpent. Email
questions can go to [email protected] A commercial version of Serpent is
available as "Agora" from ASET, 221 Woodhaven Drive, Pittsburgh, PA 15228.
Garnet is a Common Lisp-based GUI toolkit. Information is available
from [email protected]
MetaCard is a hypertext/Rapid Application Development environment
similar to Apple/Claris Corporation's HyperCard ([email protected]). MetaCard
is available via anonymous FTP from ftp.metacard.com, csn.org, or
128.138.213.21.

----------------------------------------------------------------------
~Subject: 89) Where can I find X tools callable from shell scripts?
I want to have a shell script pop up menus and yes/no dialog boxes if the user
is running X.

Several tools in the R3 contrib/ area were developed to satisfy these
needs: yorn pops up a yes/no box, xmessage displays a string, etc. There are
several versions of these tools; few, if any, have made it to the R4 contrib/
area, though they may still be available on various archive sites.
In addition, Richard Hesketh ([email protected]) has posted the xmenu
package to comp.sources.x ("v08i008: xmenu") for 1-of-n choices. [7/90]
Two versions of XPrompt have been posted to comp.sources.x, the latter
being an unauthorized rewrite. [R. Forsman ([email protected]), 1/91]
There is a version of XMenu available from comp.sources.x; it is
being worked on and will likely be re-released.
xp-1.1.tar.Z, xpick-1.0.tar.Z and xzap-1.0.tar.Z on export's contrib/
are tools by [email protected] which act as X versions of the
simple display and choice-making tools in K&P. [4/92]
xtpanel lets the user build a panel containing interactive objects such
as buttons, sliders, text fields, etc., either from the command line or using a
simple scripting language. It is available for anonymous ftp from
hanauma.Stanford.EDU (36.51.0.16) as pub/X/xtpanel.tar.Z and may also be found
in the alt.sources archives.

----------------------------------------------------------------------
~Subject: 90)! Where can I get an X-based debugger?

xdbx, an X interface to the dbx debugger, is available via ftp from
export. The current [1/91] version is 2.1 patchlevel 2.
An X interface to gdb called xxgdb is more like xdbx 2.1.2. It is part
of comp.sources.x volume 11 [2/91].
mxgdb is a Motif interface to gdb by Jim Tsillas
([email protected]); version 1.1.5 was released 1/93.
UPS is a source-level debugger which runs under the X11 and SunView
window systems on Sun and DEC platforms. It is available from export
(18.24.0.11) as contrib/ups-2.45.tar.Z and unix.hensa.ac.uk (129.12.21.7) in
/pub/misc/unix/ups (or try mail to [email protected]). [10/92]
Unofficial fixes by Rod Armstrong ([email protected]) are on unix.hensa.ac.uk
in /misc/unix/ups/contrib/[email protected]

Also:
MIPS produces a highly-customizable (WCL-based) Visual Debugger.
You should be able to use Sun's dbxtool with its X11/NeWS server.
The CodeCenter (617-498-3000) source-level debugger, available on most
major platforms, includes an X-based interface.
AT&T offers the eXamine Graphical Interface, an X11 interface to dbx
and C++ dbx for Sun3 and Sun4 and sdb and sdb++ for 386 and 3B2 platforms. Call
1-508-960-1997 or contact [email protected] for more information.
Solbourne (+1 303-678-4626) offers PDB, its X-based debugger for C, C++
and Fortran. PDB uses the OI toolkit and runs in either Open Look or Motif
mode.
SCO ([email protected]) offers dbXtra as part of several development
systems.

----------------------------------------------------------------------
~Subject: 91) How can I "tee" an X program identically to several displays?

There are several protocol multiplexer tools which provide for the
simultaneous display of X clients on any number of machines.
XMX (an X Protocol Multiplexor) is available from wilma.cs.brown.edu
(128.148.31.66) as pub/xmx.tar.Z It works independently of the server and does
not affect the application being shared; it was developed for use in the
electronic classroom.
XTV is a conference program which can be used to duplicate the
"chalkboard" on several displays. Release 1 is available on the X11R5 contrib
tapes; a more recent version is on ftp.cs.odu.edu as pub/wahab/XTV.r2.tar.Z.
SHX from Michael Altenhofen of Digital Equipment GmbH CEC Karlsruhe
also does this; it is a "WYSIWIS" (What You See Is What I See) package in the
context of a computer-based learning/training tool to provide online help from
remote tutors but is also useful for general window sharing. Information:
[email protected] SHX can be found on export and
gatekeeper.dec.com:/pub/X11/contrib/shX.tar.Z,
crl.dec.com:/pub/X11/contrib/shX.tar.Z
Modifications to SHX for color mapping and private color allocation by
Mark J. Handley ([email protected]) are on cs.ucl.ac.uk in
car/shX.car.tar.Z.
XTrap is implemented as a server/library extension and can be used
to record and then replay an x session. It is available as:
gatekeeper.dec.com pub/X11/contrib/XTrap_v31.tar.Z
export.lcs.mit.edu contrib/XTrap_v31.tar.Z
wscrawl can be used as a "multi-person paint program". It's available
on sax.stanford.edu as wscrawl.shar.Z.
Shdr implements a simple shared whiteboard, without a chalk-passing
mechanism. It's available on parcftp.xerox.com as pub/europarc/shdr.tar.Z.

Also of use:
Hewlett-Packard Co. has a commercial product, "HP SharedX" which works
under HP-UX currently on their 300, 400, and 700 series workstations and their
HP 700/RX X Stations. Machines receiving shared windows can be any X server.
HP SharedX consists of a server extensions and a Motif based user interface
process. Contact your local HP sales rep. for more information.
IBM offers a commercial product.
Sun offers multi-user confering software called ShowMe.
InSoft (Mechanicsburg, PA, USA) offers multi-user confering software
called Communique.

[Thanks in part to [email protected] (Tim Scott), 5/91, and to Peter Cigehn
([email protected]), 8/92 ]

----------------------------------------------------------------------
~Subject: 92) TOPIC: BUILDING THE X DISTRIBUTION [topic needs updating to R5]
----------------------------------------------------------------------
~Subject: 93) What's a good source of information on configuring the X build?

This FAQ includes information on a number of "gotchas" that can bite
you on particular system. However, the best source of general information on
building the X11 release is found in the Release Notes. The file is bundled
separately from the rest of the release, so if it's become separated from your
sources you can FTP another copy separately: the file RELNOTES.[ms,PS,TXT] at
the top of the distribution. The file RELNOTES is also available from the
xstuff mail server.
In addition, O'Reilly & Associates's Volume 8 on X Administration
includes information on configuring and building X.

----------------------------------------------------------------------
~Subject: 94) Why doesn't my Sun with a cg6 work with R5?

Apparently gcc is the problem; it seems to produce fine code for all
Sun displays except for the cgsix. The new sunGX.o distributed with fix-07
may fix the problem (note: not known to work on Solaris).

----------------------------------------------------------------------
~Subject: 95) Why doesn't my Sun with SunOS 4.1 know about _dlsym, etc.?

If you get errors with _dlsym _dlopen _dlclose undefined, link with
libdl.a. Add "-ldl" to your and eventually your site.def. You may want to
surround it with "-Bstatic -ldl -Bdynamic" if you add it to the EXTRA_LIBRARIES
variable, since "syslibs" get added after EXTRA_LIBRARIES on the eventual
compilation command; otherwise you may not have a shared libdl. (Or compile
the stubs shared.)

[thanks to Joe Backo ([email protected]), 12/91]

----------------------------------------------------------------------
~Subject: 96) What is this strange problem building X clients on SunOS 4.1.2?

In SunOS 4.1.2 Sun fixed a shared-library bug in ld which conflicts
with the way X11R4 builds the shared Xmu library, causing these symbols to be
undefined when building some X11 clients:
_get_wmShellWidgetClass
_get_applicationShellWidgetClass
Compiling "-Bstatic -lXmu -Bdynamic" appears to work.

To solve the problem if you are using OpenWindows 3.0 (X11R4-based Xt), please
contact your local Sun office and request the following patches:

Patch i.d. Description
100512-02 4.1.x OpenWindows 3.0 libXt Jumbo patch
100573-03 4.1.x OpenWindows 3.0 undefined symbols when using
shared libXmu

[Greg Earle, [email protected]; 7/92]

A source patch for use with the MIT X11R4 libraries was developed by Conrad
Kimball ([email protected]); it retrofits into R4 some fixes made in R5 to
get around this problem. The patch is on export in [1/93]
contrib/X11R4_sunos4.1.2_patch_version3.Z

----------------------------------------------------------------------
~Subject: 97) Why can't gcc compile X11R4 on my SPARC?
I used gcc to compile the whole distribution, but I get several segmentation
faults when running X.

Note first that gcc on RISC machines does not necessarily result in
any performance increase; it certainly is not as noticeable as it is on the
680x0 or VAX platforms.

Here is the problem: gcc and cc use incompatible methods of passing
structures as arguments and returning them as function values, so when
gcc-compiled parts of X are linked with Sun-supplied functions that pass or
return structs, run-time errors occur. Affected programs include rgb and
the server.

This is from the GCC manual:

On the Sparc, GNU CC uses an incompatible calling convention for
structures. It passes them by including their contents in the argument
list, whereas the standard compiler passes them effectively by
reference.

This really ought to be fixed, but such calling conventions are not yet
supported in GNU CC, so it isn't straightforward to fix it.

The convention for structure returning is also incompatible, and
`-fpcc-struct-return' does not help.

You can duck the problem either by using cc throughout or by using it for just
the routines which cause incompatibilities; the problem cannot be solved with
compilation flags.

Files which need to be compiled using cc include:
server/os/4.2bsd/oscolor.c
rgb/rgb.c

In addition, several of the "inet_" functions use structs as args or
return values:
clients/xhost/xhost.c
clients/xauth/gethost.c.
Calls to inet_addr in /lib/CLX/socket.c and lib/X/XConnDis.c are possibly
harmless as they don't involve structs.

[collected by [email protected] (Don Bashford); 8/90]

----------------------------------------------------------------------
~Subject: 98) What are these I/O errors running X built with gcc?
When I try to run xinit or the Xsun server I get the error
"Getting interface configuration: Operation not supported on socket.
Fatal server bug! no screens found."

Running the gcc fixincludes script apparently didn't work. You can do
this simple test:

#include
SIOCGIFCONF

Run that through cc -E and gcc -E. The last line of output is the piece of
interest; it should be identical (modulo irrelevant differences like
whitespace). If the gcc version has 'x' where the cc version has 'i', your
fixincludes run didn't work for some reason or other; go back to your gcc
sources and run `fixincludes`; then rebuild the X distribution. If they are
identical, try running a make clean in mit/server and rebuilding, just to make
sure everything gets compiled with the proper include files.

[courtesy der Mouse, [email protected]; 9/90]

----------------------------------------------------------------------
~Subject: 99) What are these problems compiling X11R4 on the older Sun3?
In mit/server/ddx/sun/sunCG3C.c, we have found "missing" defines for
CG3AC_MONOLEN, CG3BC_MONOLEN, CG3AC_ENBLEN, CG3BC_ENBLEN. What should these be?

The R4 Errata list distributed after X11R4 mentions that you can add
these lines to the file on older SunOS versions (e.g. 3.5) to compile:
#define CG3AC_MONOLEN (128*1024)
#define CG3AC_ENBLEN CG3AC_MONOLEN
#define CG3BC_MONOLEN CG3AC_MONOLEN
#define CG3BC_ENBLEN CG3AC_MONOLEN

However, the Sun3 should not actually ever have the CG3 device, and so
references to it can be removed from mit/server/ddx/sun/sunInit.c and the
Imakefile. [11/90]

----------------------------------------------------------------------
~Subject: 100) What are these problems compiling the X server on SunOS 4.1.1?
The file isn't being found.

Sun omitted from SunOS 4.1.1. Remove the #include
from sunCG6C.c and replace it with the line
#define CG6_VADDR_COLOR 0x70016000
The file has changed from earlier versions of SunOS and should not be copied
from another distribution.

----------------------------------------------------------------------
~Subject: 101) What are these problems using R4 shared libraries on SunOS 4?
All of the executables that I try to run have the following results:
ld.so: libXmu.so.4: not found
or even:
ld.so: call to undefined procedure __GetHostname from 0xf776a96c

If you are building with shared libraries on a Sun, remember that you
need to run "ldconfig" as root after installing the shared libraries (if you've
installed X on a file-server, run it on the server's clients, too). While
building and installing the distribution, you need to be careful to avoid
linking against any existing X shared libraries you might have (e.g. those
distributed with OpenWindows). You should make sure you do not have
LD_LIBRARY_PATH set in your environment during the build or the installation.
If you are going to keep xterm and xload as setuid programs, please note that
the shared libraries must be installed in /usr/lib, /usr/local/lib, or
/usr/5lib for these programs to work (or else those programs must be linked
statically). [courtesy MIT X Consortium]
Note also that the program mkfontdir is run as part of the build; it
attempts, however, to use the shared libraries before they have been installed.
You can avoid the errors by building mkfontdir statically (pass -Bstatic to
most C compilers).

----------------------------------------------------------------------
~Subject: 102) Can OLIT programs run with R5 Xt? (_XtQString undefined)

This is a bug in the OLIT. _XtQString was an external symbol that existed in
X11R4 (upon which OW 3.0's libXt is based). It wasn't documented and was
removed in X11R5 (MIT's guarantee of upward compatibility between the R4 and R5
libraries only applied to the documented interface).

A workaround is to temporarily set your LD_LIBRARY_PATH to point to the X11R5
Xt library that you linked the program against.

[10/92; from Barry Margolin ([email protected])

----------------------------------------------------------------------
~Subject: 103) How do I get around the SunOS 4.1 security hole?

There is a security problem with certain R4 clients (xterm and xload)
running under SunOS 4.1 that have been installed setuid root and are using
shared libraries; to avoid the problem, do one of these:
1) make the program non-setuid. You should consult your system
administrator concerning protection of resources (e.g. ptys and /dev/kmem) used
by these programs, to make sure that you do not create additional security
problems at your site.
2) relink the programs statically (using -Bstatic).
3) install the libraries before linking and link with absolute paths
to the libraries.

[from [email protected] (Bob Scheifler), 12/90]

The R5 version of xterm does this automatically by rebuilding xterm against the
newly-installed libraries when xterm is being installed; this prevents an suid
program from being built with libraries specified relatively. Note that this
may cause an inconvenience when doing the installation from NFS-mounted disks.
Xload has been rewritten to avoid the problem.

----------------------------------------------------------------------
~Subject: 104)+ How do I get around the frame-buffer security hole?

On many systems the frame-buffer is unsecured by default; this permits
anyone who can log into your workstation to peek at your windowing session by
accessing the frame-buffer directly, or, as less of a privacy issue but perhaps
more annoying, to [accidentally] start up a second X session on your console
display. Check the man page for fbtab(5).

[Thanks to Art Mulder ([email protected]); 2/93.]

----------------------------------------------------------------------
~Subject: 105) TOPIC: BUILDING X PROGRAMS
----------------------------------------------------------------------
~Subject: 106)! What is Imake?

Imake is not a replacement for the make program; instead, it is a
makefile-generator that takes advantages of the include-file and macro-
processing capabilities of the C preprocessor cpp to generate makefiles
suitable for building software on a particular system. Although it is not
specific to X, the X release uses it to help solve a number of the
configuration issues that arise in making such a large system widely portable.
Imake has a fairly steep learning curve, in part because the process by
which the system-specific configuration files, system-independent configuration
files, and individual Imakefiles are melded to produce a Makefile is not
obvious.
There have been several different versions of imake; the R3, R4, and
R5 versions are different.

You can obtain information on imake from these sources:
- the R4 and R5 release notes and imake man page include information on
using Imake to build X
- the R4 and R5 file mit/config/README also contains useful information
- on the R4 tapes, contrib/doc/imake/imake.tex is Mark Moraes' R3/R4
guide to imake.
- the R5 mit/doc/config/usenixws/paper.ms contains a paper by Jim
Fulton on an early version of Imake
- Paul Dubois ([email protected]) has written a useful
explanation of how Imake works and how to use it in configuring X for non-
supported systems; the document is available from ftp.primate.wisc.edu
in the directory ~ftp/pub/imake-stuff; look for config-X11R4.ms (troff) and
config-X11R4.ps (PostScript). Some supplemental appendices are nearby.
[7/91: document version is now 1.06] These imake papers are available by email;
mail a message body of "send imake-stuff help" to [email protected]
- see "System Administration - Imake: Friend of Foe?" by Dinah McNutt
in the November 1991 issue of SunExpert.
- German readers should expect in June 1992 an article "Das Meta-Make
/ I make, you make / Schwerelos" by Rainer Klute in "iX
Multiuser-Multitasking-Magazin", directed at application programmers needing to
write Imakefiles. An English-language derivative of this article is in The
X Journal, issue 2:1.
- The O'Reilly X Resource issue #2 contains Paul Davey's article on
demystifying Imake.
- Alain Brossard's working document full of tips on Imake is in
sasun1.epfl.ch:pub/imakefile.1.Z.

[1/91;12/91;5/92;8/92]

----------------------------------------------------------------------
~Subject: 107) Where can I get imake?

Versions are distributed with the R4 and R5 releases. An earlier
version is distributed with the X11R3 release; some third-party toolkits
redistribute versions of imake along with their own implementations of the
template and configuration files. There are no real standards for such
configuration files, although most *current* contributed software expects the
templates distributed with X11R5.
export contains the R5 distribution unpacked, so you can pick up imake
without picking up the entire distribution.
A stand-alone version of Imake, but one stemming from X11R5, is in
ftp.germany.eu.net:pub/X11/misc/imake/imake-pure.tar.Z (192.76.144.75).

----------------------------------------------------------------------
~Subject: 108) I have a program with an Imakefile but no Makefile. What to do?

If you have R4 or R5 installed on your system, run "xmkmf". This is a
script which runs imake for you with the correct arguments. The output is a
Makefile configured for your system and based on the Imakefile. Then run make,
which will use that new Makefile to compile the program.

----------------------------------------------------------------------
~Subject: 109) Why can't I link to the Xlib shape routines?
When I try to compile certain programs, I get the following link error:
Undefined:
_XShapeQueryExtension
_XShapeCombineMask

These routines are actually part of the Shape Extension to X (SHAPE)
which was introduced in the MIT X11R4 distribution and allows non-rectangular
windows. Like the other sample server extensions, the shape extension will
only run on a server which supports it. Pre-X11R4 servers, as well as many
vendor-supplied servers, do not support the shape extension, in which case
they will display rectangular windows anyway.

In order to use the shape extension, you must link to the library
libXext.a. In the X11R4 distribution, this library and the associated includes
will be in the mit/extensions directory. If you do not have these files, do
not despair: many freeware programs which use the shape extension can also be
compiled without it by removing the -DSHAPE define from the Makefile; you can
probably do this and compile successfully against your older vendor-supplied X
libraries.

[from John B. Melby, melby%[email protected], 3/91]

----------------------------------------------------------------------
~Subject: 110) What are these problems with "_XtInherit not found" on the Sun?
When I run a X program that I wrote on a SunOS 4.0.3 or 4.1 machine I get the
error "ld.so: symbol not found _XtInherit".

What you are seeing is a side-effect of a kludge in the R4 libXt.a to
get Sun shared libraries working. Apparently, you can't share a function that
is both called and compared, as _XtInherit is. This was handled by putting
_XtInherit in the same file as a function that is always used, thereby
guaranteeing that it would be loaded -- that is, in Initialize.c, where
XtToolkitInitialize() and XtInitialize() reside. These routines would normally
be called.

You are probably seeing this error because your program is not a normal
Xt-based program and does not call XtToolkitInitialize() anywhere.
1) it may be a program that uses Xt functions but never opens a
connection to the X server. [OSF/Motif's 1.1.0 UIL had this problem; it called
XtMalloc() and other Xt functions.] The solution is to add the call to your
program; the function does not have to be executed, just linked in.
2) alternatively, your program doesn't need any Xt functions and is
correct in not calling XtToolkitInitialize() -- it may be an Xlib or XView
program. In this case, you can remove -lXt from your link command.

It should not be necessary to link the shared libraries statically,
although this will certainly solve the problem.

[from Jordan Hayes (now [email protected]) and Danny Backx ([email protected]);
11/90]

----------------------------------------------------------------------
~Subject: 111) Why can't I compile my R3 Xaw contrib programs under the new X?
I have a program that worked well under X11R3. When I try to link it under
the current version of X, I get this message:
Undefined:
_XtScrollBarSetThumb
_XtTextSetInsertionPoint
_XtTextReplace

There were several name changes in the Athena widget set (in addition
to the header files moving into ); these are mentioned in the R4
release notes. In this case, these functions are not really Xt functions but
are part of the Xaw text widget and so have been renamed from Xt* to Xaw*.
[10/90]

----------------------------------------------------------------------
~Subject: 112) TOPIC: PROGRAMMING PROBLEMS AND PUZZLES
----------------------------------------------------------------------
~Subject: 113) Why doesn't my program get the keystrokes I select for (sic)?

The window manager controls how the input focus is transferred from one
window to another. In order to get keystrokes, your program must ask the
window manager for the input focus. To do this, you must set up what are
called "hints" for the window manager. If your applications is Xlib-based, you
can use something like the following:

XWMHints wmhints;
...
wmhints.flags = InputHint;
wmhints.input = True;
XSetWMHints(dpy, window, &wmhints)

If your application is based on the Xt Intrinsics, you can set the XtNinput
resource to be True (as you probably want to in any case); if you don't have
source, you can start up the application with the resource '*input:True'.

Certain window managers, notably dxwm and olwm, are very picky about having
this done.

If you are using Sun's OpenWindows olwm, you can also add this resource
to your defaults file to use clients that aren't ICCCM-compliant.
OpenWindows.FocusLenience: true

[mostly courtesy Dave Lemke of NCD and Stuart Marks of Sun]

----------------------------------------------------------------------
~Subject: 114) How do I figure out what window manager is running?

You can't reliably tell; whatever mechanism you could use could be
spoofed in any case.
For most cases, you shouldn't care which window manager is running, so
long as you do things in an ICCCM-conformant manner. There are some cases in
which particular window managers are known to do things wrong; checking for
particular hints placed on the window by the window manager so that you can
sidestep the problem may be appropriate in these cases. Alternatively, it may
be appropriate to determine which window manager is running in order to take
advantage of specific *added* features (such as olwm's push-pin menus) in order
to give your program *added* functionality. Beware of usurping the window
manager's functions by providing that functionality even when it is missing;
this surely leads to future compatibility problems.

----------------------------------------------------------------------
~Subject: 115) Is there a skeleton X program available?

There is no general framework such as the TransSkel program for the
Macintosh which handles lots of the odds and ends and overhead of development
under a window system and which can be used as a platform for additional
development. In X, the problem is typically solved by using an interactive
application builder tool or by using cut&paste on existing X applications. Good
applications which you might look to manipulate when you want to "test just
this one little thing" include contrib/clients/xskel, a simple R4 program that
puts up a window and allows sketching in it and offers a starting point for
quick hacks, the Xaw examples in the examples/ directory in the R3 and R4
distributions, and the Xlib "Hello World" example in the R3 doc/HelloWorld and
R4 doc/tutorials/HelloWorld; an updated version of this program which uses R4
Xlib calls and current ICCCM conventions was posted in 2/90 to comp.windows.x
by Glenn Widener of Tektronix. [3/90]

In addition, a sample Xt program (for Xaw or Xm) by Rainer Klute
showing how to open multiple displays and how to catch a broken display
connection is available on export.lcs.mit.edu in contrib/mdisp.tar.Z. [4/92]

----------------------------------------------------------------------
~Subject: 116) Why does XtGetValues not work for me (sic)?

The XtGetValues interface for retrieving resources from a widget is
sensitive to the type of variable. Your code may be doing something like this:
{
Arg args[3];
int i;
int sensitive;/* oops; wrong data type */
i=0;
XtSetArg (args[i], XtNsensitive, &sensitive); i++;
XtGetValues(widget, args, i );
...
}

But XtNsensitive is a Boolean, which on most machines is a single byte;
declaring the variable "sensitive" as Boolean works properly. This problem
comes up often when using particular toolkits that redefine the Xt types
Dimension and Position; code that assumes they are int will have similar
problems if those types are actually short. In general: you are safe if you
use the actual type of the resource, as it appears in the widget's man page.
[11/90]

----------------------------------------------------------------------
~Subject: 117) Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?

You're probably trying to use these functions from application code.
They should be used only internally to widgets; these functions are for a
parent widget to change the geometry of its children. Other promising
functions, XtMakeGeometryRequest() and XtMakeResizeRequest(), are also for use
only by widgets, in this case by a child to request a change from its parent.
The only way for your application to request a geometry change for a
widget is to issue an XtSetValues call setting some of the geometry resources.
Although this will result in the widget-internal functions' being called, your
application code must use the standard XtSetValues interface or risk the
widgets' data becoming corrupted.
[The Xlib calls XMoveWindow() and XResizeWindow() should similarly be
avoided; they shouldn't be used to change XtNx, XtNy, XtNwidth, or XtNheight.]

----------------------------------------------------------------------

David B. Lewis faq%[email protected]

"Just the FAQs, ma'am." -- Joe Friday
--
David B. LewisTemporarily at but not speaking for Visual, Inc.
day: [email protected]: david%[email protected]

From: [email protected] (David B. Lewis)
Newsgroups: comp.windows.x,news.answers,alt.answers,comp.answers
Subject: comp.windows.x Frequently Asked Questions (FAQ) 5/5
Summary: useful information about the X Window System
Date: 8 Feb 93 14:40:32 GMT
Reply-To: faq%[email protected] (X FAQ maintenance address)

Archive-name: x-faq/part5
Last-modified: 1993/02/06

----------------------------------------------------------------------
~Subject: 118) Why isn't there an XtReparentWidget call like XReparentWindow?

Although there are various details of the current implementation of
the Xt internals which make reparenting difficult, the major reason that no
such call exists is that it remains undefined what the set of resources for
the "new" widget should be. Resources are typically set based on the location
in the instance hierarchy; what resources should change if the instance moves?
What should happen to the widget's children? And by the time such semantics are
defined, there would probably be little advantage over destroying the old
widget and creating a new widget in the correct location with the desired
resources, as setting the resources correctly is the majority of work in
creating a new widget.

Note that reparenting is possible in the OI toolkit.

----------------------------------------------------------------------
~Subject: 119) I'm writing a widget and can't use a float as a resource value.

Float resources are not portable; the size of the value may be larger than
the size of an XtPointer. Try using a pointer to a float instead; the Xaw
Scrollbar float resources are handled in this way.

----------------------------------------------------------------------
~Subject: 120) Is this a memory leak in the X11R4 XtDestroyWidget()?!

Yes. This is the "unofficial" fix-19 for the X11R4 Destroy.c:

*** Destroy.c.1.37Thu Jul 11 15:41:25 1991
--- lib/Xt/Destroy.cThu Jul 11 15:42:23 1991
***************
*** 1,4 ****
--- 1,5 ----
/* $XConsortium: Destroy.c,v 1.37 90/09/28 10:21:32 swick Exp $ */
+ /* Plus unofficial patches in revisions 1.40 and 1.41 */

/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
***************
*** 221,239 ****
*/

int i = 0;
! DestroyRec* dr = app->destroy_list;
while (i < app->destroy_count) {
if (dr->dispatch_level >= dispatch_level) {
Widget w = dr->widget;
if (--app->destroy_count)
bcopy( (char*)(dr+1), (char*)dr,
! app->destroy_count*sizeof(DestroyRec)
);
XtPhase2Destroy(w);
}
else {
i++;
- dr++;
}
}
}
--- 222,245 ----
*/

int i = 0;
! DestroyRec* dr;
while (i < app->destroy_count) {
+
+ /* XtPhase2Destroy can result in calls to XtDestroyWidget,
+ * and these could cause app->destroy_list to be reallocated.
+ */
+
+ dr = app->destroy_list + i;
if (dr->dispatch_level >= dispatch_level) {
Widget w = dr->widget;
if (--app->destroy_count)
bcopy( (char*)(dr+1), (char*)dr,
! (app->destroy_count - i) * sizeof(DestroyRec)
);
XtPhase2Destroy(w);
}
else {
i++;
}
}
}

[from Donna Converse, [email protected]]

----------------------------------------------------------------------
~Subject: 121) Are callbacks guaranteed to be called in the order registered?

Although some books demonstrate that the current implementation of Xt
happens to call callback procedures in the order in which they are registered,
the specification does not guarantee such a sequence, and supplemental
authoritative documents (i.e. the Asente/Swick volume) do say that the order is
undefined. Because the callback list can be manipulated by both the widget and
the application, Xt cannot guarantee the order of execution.
In general, the callback procedures should be thought of as operating
independently of one another and should not depend on side-effects of other
callbacks operating; if a seqence is needed, then the single callback to be
registered can explicitly call other functions necessary.

[4/92; thanks to [email protected]]

----------------------------------------------------------------------
~Subject: 122) Why doesn't XtDestroyWidget() actually destroy the widget?

XtDestroyWidget() operates in two passes, in order to avoid leaving
dangling data structures; the function-call marks the widget, which is not
actually destroyed until your program returns to its event-loop.

----------------------------------------------------------------------
~Subject: 123) How do I query the user synchronously using Xt?

It is possible to have code which looks like this trivial callback,
which has a clear flow of control. The calls to AskUser() block until answer
is set to one of the valid values. If it is not a "yes" answer, the code drops
out of the callback and back to an event-processing loop:

void quit(Widget w, XtPointer client, XtPointer call)
{
int answer;
answer = AskUser(w, "Really Quit?");
if (RET_YES == answer)
{
answer = AskUser(w, "Are You Really Positive?");
if (RET_YES == answer)
exit(0);
}
}

A more realistic example might ask whether to create a file or whether
to overwrite it.
This is accomplished by entering a second event-processing loop and
waiting until the user answers the question; the answer is returned to the
calling function. That function AskUser() looks something like this, where the
Motif can be replaced with widget-set-specific code to create some sort of
dialog-box displaying the question string and buttons for "OK", "Cancel" and
"Help" or equivalents:

int AskUser(w, string)
Widget w;
char *string;
{
int answer=RET_NONE;/* some not-used marker */
Widget dialog;/* could cache&carry, but ...*/
Arg args[3];
int n = 0;
XtAppContext context;

n=0;
XtSetArg(args[n], XmNmessageString, XmStringCreateLtoR(string,
XmSTRING_DEFAULT_CHARSET)); n++;
XtSetArg(args[n], XmNdialogStyle, XmDIALOG_APPLICATION_MODAL); n++;
dialog = XmCreateQuestionDialog(XtParent(w), string, args, n);
XtAddCallback(dialog, XmNokCallback, response, &answer);
XtAddCallback(dialog, XmNcancelCallback, response, &answer);
XtAddCallback(dialog, XmNhelpCallback, response, &answer);
XtManageChild(dialog);

context = XtWidgetToApplicationContext (w);
while (answer == RET_NONE || XtAppPending(context)) {
XtAppProcessEvent (context, XtIMAll);
}
XtDestroyWidget(dialog); /* blow away the dialog box and shell */
return answer;
}

The dialog supports three buttons, which are set to call the same
function when tickled by the user. The variable answer is set when the user
finally selects one of those choices:

void response(w, client, call)
Widget w;
XtPointer client;
XtPointer call;
{
int *answer = (int *) client;
XmAnyCallbackStruct *reason = (XmAnyCallbackStruct *) call;
switch (reason->reason) {
case XmCR_OK:
*answer = RET_YES;/* some #define value */
break;
case XmCR_CANCEL:
*answer = RET_NO;
break;
case XmCR_HELP:
*answer = RET_HELP;
break;
default:
return;
}
}

and the code unwraps back to the point at which an answer was needed and
continues from there.

[Thanks to Dan Heller ([email protected]); further code is in Dan's R3/contrib
WidgetWrap library. 2/91]

----------------------------------------------------------------------
~Subject: 124) How do I determine the name of an existing widget?
I have a widget ID and need to know what the name of that widget is.

Users of R4 and later are best off using the XtName() function, which
will work on both widgets and non-widget objects.

If you are still using R3, you can use this simple bit of code to do
what you want. Note that it depends on the widget's internal data structures
and is not necessarily portable to future versions of Xt, including R4.

#include
#include
String XtName (widget)
Widget widget;/* WILL work with non-widget objects */
{
return XrmNameToString(widget->core.xrm_name);
}

[7/90; modified with suggestion by Larry Rogers ([email protected]) 9/91]

----------------------------------------------------------------------
~Subject: 125) Why do I get a BadDrawable error drawing to XtWindow(widget)?
I'm doing this in order to get a window into which I can do Xlib graphics
within my Xt-based program:

> canvas = XtCreateManagedWidget ( ...,widgetClass,...) /* drawing area */
> ...
> window = XtWindow(canvas);/* get the window associated with the widget */
> ...
> XDrawLine (...,window,...);/* produces error */

The window associated with the widget is created as a part of the
realization of the widget. Using a window id of NULL ("no window") could
create the error that you describe. It is necessary to call XtRealizeWidget()
before attempting to use the window associated with a widget.
Note that the window will be created after the XtRealizeWidget() call,
but that the server may not have actually mapped it yet, so you should also
wait for an Expose event on the window before drawing into it.

----------------------------------------------------------------------
~Subject: 126) Why do I get a BadMatch error when calling XGetImage?

The BadMatch error can occur if the specified rectangle goes off the edge of
the screen. If you don't want to catch the error and deal with it, you can take
the following steps to avoid the error:

1) Make a pixmap the same size as the rectangle you want to capture.
2) Clear the pixmap to background using XFillRectangle.
3) Use XCopyArea to copy the window to the pixmap.
4) If you get a NoExpose event, the copy was clean. Use XGetImage to grab the
image from the pixmap.
5) If you get one or more GraphicsExpose events, the copy wasn't clean, and
the x/y/width/height members of the GraphicsExpose event structures tell you
the parts of the pixmap which aren't good.
6) Get rid of the pixmap; it probably takes a lot of memory.

[10/92; thanks to Oliver Jones ([email protected])]

----------------------------------------------------------------------
~Subject: 127) How can my application tell if it is being run under X?

A number of programs offer X modes but otherwise run in a straight
character-only mode. The easiest way for an application to determine that it is
running on an X display is to attempt to open a connection to the X server:

display = XOpenDisplay(display_name);
if (display)
{ do X stuff }
else
{ do curses or something else }
where display_name is either the string specified on the command-line following
-display, by convention, or otherwise is (char*)NULL [in which case
XOpenDisplay uses the value of $DISPLAY, if set].

This is superior to simply checking for the existence a -display command-line
argument or checking for $DISPLAY set in the environment, neither of which is
adequate. [5/91]

----------------------------------------------------------------------
~Subject: 128) How do I make a "busy cursor" while my application is computing?
Is it necessary to call XDefineCursor() for every window in my application?

The easiest thing to do is to create a single InputOnly window that is
as large as the largest possible screen; make it a child of your toplevel
window and it will be clipped to that window, so it won't affect any other
application. (It needs to be as big as the largest possible screen in case the
user enlarges the window while it is busy or moves elsewhere within a virtual
desktop.) Substitute "toplevel" with your top-most widget here (similar code
should work for Xlib-only applications; just use your top Window):

unsigned long valuemask;
XSetWindowAttributes attributes;

/* Ignore device events while the busy cursor is displayed. */
valuemask = CWDontPropagate | CWCursor;
attributes.do_not_propagate_mask = (KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask | PointerMotionMask);
attributes.cursor = XCreateFontCursor(XtDisplay(toplevel), XC_watch);

/* The window will be as big as the display screen, and clipped by
its own parent window, so we never have to worry about resizing */
XCreateWindow(XtDisplay(toplevel), XtWindow(toplevel), 0, 0,
65535, 65535, (unsigned int) 0, CopyFromParent, InputOnly,
CopyFromParent, valuemask, &attributes);

where the maximum size above could be replaced by the real size of the screen,
particularly to avoid servers which have problems with windows larger than
32767.

When you want to use this busy cursor, map and raise this window; to go back to
normal, unmap it. This will automatically keep you from getting extra mouse
events; depending on precisely how the window manager works, it may or may not
have a similar effect on keystrokes as well.

In addition, note also that most of the Xaw widgets support an XtNcursor
resource which can be temporarily reset, should you merely wish to change the
cursor without blocking pointer events.

[thanks to Andrew Wason ([email protected]), Dan Heller
([email protected]), and [email protected]; 11/90,5/91]

----------------------------------------------------------------------
~Subject: 129) How do I fork without hanging my parent X program?

An X-based application which spawns off other Unix processes which
continue to run after it is closed typically does not vanish until all of its
children are terminated; the children inherit from the parent the open X
connection to the display.
What you need to do is fork; then, immediately, in the child process,
close (ConnectionNumber(XtDisplay(widget)));
to close the file-descriptor in the display information. After this do your
exec. You will then be able to exit the parent.

[Thanks to Janet Anstett ([email protected]) and Gordon Freedman
([email protected]) 2/91]

----------------------------------------------------------------------
~Subject: 130) Can I make Xt or Xlib calls from a signal handler?

No. Xlib and Xt have no mutual exclusion for protecting critical
sections. If your signal handler makes such a call at the wrong time (which
might be while the function you are calling is already executing), it can leave
the library in an inconsistent state. Note that the ANSI C standard points
out that behavior of a signal handler is undefined if the signal handler calls
any function other than signal() itself, so this is not a problem specific to
Xlib and Xt; the POSIX specification mentions other functions which may be
called safely but it may not be assumed that these functions are called by
Xlib or Xt functions.
You can work around the problem by setting a flag in the interrupt
handler and later checking it with a work procedure or a timer event which
has previously been added.

Note: the article in The X Journal 1:4 and the example in O'Reilly
Volume 6 are in error.

[Thanks to Pete Ware ([email protected]) and Donna Converse
([email protected]), 5/92]

----------------------------------------------------------------------
~Subject: 131) What are these "Xlib sequence lost" errors?

You may see these errors if you issue Xlib requests from an Xlib error
handler, or, more likely, if you make calls which generate X requests to Xt or
Xlib from a signal handler, which you shouldn't be doing in any case.

----------------------------------------------------------------------
~Subject: 132) How can my Xt program handle socket, pipe, or file input?

It's very common to need to write an Xt program that can accept input
both from a user via the X connection and from some other file descriptor, but
which operates efficiently and without blocking on either the X connection or
the other file descriptor.
A solution is use XtAppAddInput(). After you open your file descriptor,
use XtAppAddInput() to register an input handler. The input handler will be
called every time there is something on the file descriptor requiring your
program's attention. Write the input handler like you would any other Xt
callback, so it does its work quickly and returns. It is important to use only
non-blocking I/O system calls in your input handlers.
Most input handlers read the file descriptor, although you can have an
input handler write or handle exception conditions if you wish.
Be careful when you register an input handler to read from a disk file.
You will find that the function is called even when there isn't input pending.
XtAppAddInput() is actually working as it is supposed to. The input handler is
called whenever the file descriptor is READY to be read, not only when there is
new data to be read. A disk file (unlike a pipe or socket) is almost always
ready to be read, however, if only because you can spin back to the beginning
and read data you've read before. The result is that your function will almost
always be called every time around XtAppMainLoop(). There is a way to get the
type of interaction you are expecting; add this line to the beginning of your
function to test whether there is new data:
if (ioctl(fd, FIONREAD, &n) == -1 || n == 0) return;
But, because this is called frequently, your application is effectively in a
busy-wait; you may be better off not using XtAppAddInput() and instead setting
a timer and in the timer procedure checking the file for input.

[courtesy Dan Heller ([email protected]), 8/90; [email protected] 5/91;
Ollie Jones ([email protected]) 6/92]

----------------------------------------------------------------------
~Subject: 133) How do I simulate a button press/release event for a widget?

You can do this using XSendEvent(); it's likely that you're not setting
the window field in the event, which Xt needs in order to match to the widget
which should receive the event.
If you're sending events to your own application, then you can use
XtDispatchEvent() instead. This is more efficient than XSendEvent() in that you
avoid a round-trip to the server.
Depending on how well the widget was written, you may be able to call
its action procedures in order to get the effects you want.

[courtesy Mark A. Horstman ([email protected]), 11/90]

----------------------------------------------------------------------
~Subject: 134) Why doesn't anything appear when I run this simple program?

> ...
> the_window = XCreateSimpleWindow(the_display,
> root_window,size_hints.x,size_hints.y,
> size_hints.width,size_hints.height,BORDER_WIDTH,
> BlackPixel(the_display,the_screen),
> WhitePixel(the_display,the_screen));
> ...
> XSelectInput(the_display,the_window,ExposureMask|ButtonPressMask|
> ButtonReleaseMask);
> XMapWindow(the_display,the_window);
> ...
> XDrawLine(the_display,the_window,the_GC,5,5,100,100);
> ...

You are right to map the window before drawing into it. However, the
window is not ready to be drawn into until it actually appears on the screen --
until your application receives an Expose event. Drawing done before that will
generally not appear. You'll see code like this in many programs; this code
would appear after window was created and mapped:
while (!done)
{
XNextEvent(the_display,&the_event);
switch (the_event.type) {
case Expose: /* On expose events, redraw */
XDrawLine(the_display,the_window,the_GC,5,5,100,100);
break;
...
}
}

Note that there is a second problem: some Xlib implementations don't
set up the default graphics context to have correct foreground/background
colors, so this program could previously include this code:
...
the_GC_values.foreground=BlackPixel(the_display,the_screen);/* e.g. */
the_GC_values.background=WhitePixel(the_display,the_screen);/* e.g. */
the_GC = XCreateGC(the_display,the_window,
GCForeground|GCBackground,&the_GC_values);
...

Note: the code uses BlackPixel and WhitePixel to avoid assuming that 1 is
black and 0 is white or vice-versa. The relationship between pixels 0 and 1
and the colors black and white is implementation-dependent. They may be
reversed, or they may not even correspond to black and white at all.

Also note that actually using BlackPixel and WhitePixel is usually the wrong
thing to do in a finished program, as it ignores the user's preference for
foreground and background.

And also note that you can run into the same situation in an Xt-based program
if you draw into the XtWindow(w) right after it has been realized; it may
not yet have appeared.

----------------------------------------------------------------------
~Subject: 135) What is the difference between a Screen and a screen?

The 'Screen' is an Xlib structure which includes the information about
one of the monitors or virtual monitors which a single X display supports. A
server can support several independent screens. They are numbered unix:0.0,
unix:0.1, unix:0.2, etc; the 'screen' or 'screen_number' is the second digit --
the 0, 1, 2 which can be thought of as an index into the array of available
Screens on this particular Display connection.
The macros which you can use to obtain information about the particular
Screen on which your application is running typically have two forms -- one
which takes a Screen and one with takes both the Display and the screen_number.
In Xt-based programs, you typically use XtScreen(widget) to determine
the Screen on which your application is running, if it uses a single screen.
(Part of the confusion may arise from the fact that some of the macros
which return characteristics of the Screen have "Display" in the names --
XDisplayWidth, XDisplayHeight, etc.)

----------------------------------------------------------------------
~Subject: 136) Can I use C++ with X11? Motif? XView?

The X11R4/5 header files are compatible with C++. The Motif 1.1 header
files are usable as is inside extern "C" {...}. However, the definition of
String in Intrinsic.h can conflict with the libg++ or other String class and
needs to be worked around.

Some other projects which can help:
WWL, a set of C++ classes by Jean-Daniel Fekete to wrap X Toolkit
widgets, available via anonymous FTP from export.lcs.mit.edu as
contrib/WWL-1.2.tar.Z [7/92] or lri.lri.fr (129.175.15.1) as pub/WWL-1.2.tar.Z.
It works by building a set of C++ classes in parallel to the class tree of the
widgets.
The C++ InterViews toolkit is obtainable via anonymous FTP from
interviews.stanford.edu. InterViews uses a box/glue model similar to that of
TeX for constructing user interfaces and supports multiple looks on the user
interfaces. Some of its sample applications include a WYSIWIG document editor
(doc), a MacDraw-like drawing program (idraw) and an interface builder
(ibuild).
THINGS, a class library written at the Rome Air Force Base by the
Strategic Air Command, available as freeware on archive sites.

Motif++ is a public-domain library that defines C++ class wrappers for
Motif 1.1; it adds an "application" class for, e.g., initializing X, and also
integrates WCL and the Xbae widget set. This work was developed by Ronald van
Loon based on X++, a set of bindings done by the University
of Lowell Graphics Research Laboratory. The current sources are available from
decuac.dec.com (192.5.214.1) as /pub/X11/motif++.21.jul.92.tar.Z.

The source code examples for Doug Young's "Object-Oriented Programming
with C++ and OSF/Motif" [ISBN 0-13-630252-1] do not include "widget wrappers"
but do include a set of classes that encapsulates higher-level facilities
commonly needed by Motif- or other Xt-based applications; check export in
~ftp/contrib/young.c++.tar.Z.
Rogue Wave offers "View.h++" for C++ programmers using Motif; info:
1-800-487-3217 or +1 503 754 2311.
A product called "Commonview" by Glockenspiel Ltd, Ireland (??)
apparently is a C++-based toolkit for multiple window systems, including PM,
Windows, and X/Motif.
Xv++ is sold by Qualix (415-572-0200; fax -1300); it implements an
interface from the GIL files that Sun's OpenWindows Developers Guide 3.0
produces to Xview wrapper classes in C++.

UIT is a set of C++ classes embedding the XView toolkit; it is intended
for use with Sun's OpenWindows Developers Guide 3.0 builder tool. Sources are
on export.mit.edu.au as UIT.tar.Z. Version 2 was released 5/28/92.

Also of likely use is ObjectCenter (Saber-C++). And a reasonable
alternative to all of the above is ParcPlace's (formerly Solbourne's) Object
Interface.

[Thanks to Douglas S. Rand ([email protected]) and George Wu ([email protected]);2/91]

----------------------------------------------------------------------
~Subject: 137) Where can I obtain alternate language bindings to X?

Versions of the CLX Lisp bindings are part of the X11 core source
distributions. A version of CLX is on the R5 tape [10/91]; version 5.0.2 [9/92]
is on export.lcs.mit.edu in /contrib/CLX.R5.02.tar.Z.

The SAIC Ada-X11 bindings are through anonymous ftp in /pub from
stars.rosslyn.unisys.com (128.126.164.2).
There is an X/Ada study team sponsored by NASA JSC, which apparently is
working out bindings. Information: [email protected]
GNU SmallTalk has a beta native SmallTalk binding to X called STIX (by
[email protected]). It is still in its beginning stages, and
documentation is sparse outside the SmallTalk code itself. The sources are
available as /pub/gnu/smalltalk-1.1.1.tar.Z on prep.ai.mit.edu (18.71.0.38) or
ugle.unit.no (129.241.1.97).
Prolog bindings (called "XWIP") written by Ted Kim at UCLA while
supported in part by DARPA are available by anonymous FTP from
export.lcs.mit.edu:contrib/xwip.tar.Z or ftp.cs.ucla.edu:pub/xwip.tar.Z.
These prolog language bindings depend on having a Quintus-type foreign function
interface in your prolog. The developer has gotten it to work with Quintus and
SICStus prolog. Inquiries should go to [email protected] [3/90]
Scheme bindings to Xlib, OSF/Motif, and Xaw are part of the Elk
distribution; version 1.5a on export obsoletes the version on the R5 contrib
tape.
x-scm, a bolt-on accessory for Aubrey Jaffer's "scm" Scheme interpreter
that provides an interface to Xlib, Motif, and OpenLook, is now available via
FTP from altdorf.ai.mit.edu:archive/scm/xscm1.05.tar.Z and
nexus.yorku.ca:pub/scheme/new/xscm1.05.tar.Z.

Ada bindings to Motif, explicitly, will eventually be made available by
the Jet Propulsion Laboratories, probably through the normal electronic
means. Advance information can be obtained from [email protected],
who may respond as time permits.
AdaMotif is a complete binding to X and Motif for the Ada language, for
many common systems; it is based in part upon the SAIC/Unisys bindings and also
includes a UIL to Ada translator. Info: Systems Engineering Research
Corporation, 1-800-Ada-SERC ([email protected]).

Also: the MIT Consortium, although not involved in producing Ada
bindings for X, maintains a partial listing of people involved in X and Ada;
information is available from Donna Converse, [email protected]

----------------------------------------------------------------------
~Subject: 138) Can XGetWindowAttributes get a window's background pixel/pixmap?

No. Once set, the background pixel or pixmap of a window cannot be
re-read by clients. The reason for this is that a client can create a pixmap,
set it to be the background pixmap of a window, and then free the pixmap. The
window keeps this background, but the pixmap itself is destroyed. If you're
sure a window has a background pixel (not a pixmap), you can use XClearArea()
to clear a region to the background color and then use XGetImage() to read
back that pixel. However, this action alters the contents of the window, and
it suffers from race conditions with exposures. [courtesy Dave Lemke of NCD
and Stuart Marks of Sun]

Note that the same applies to the border pixel/pixmap. This is a
(mis)feature of the protocol which allows the server is free to manipulate the
pixel/pixmap however it wants. By not requiring the server to keep the
original pixel or pixmap, some (potentially a lot of) space can be saved.
[courtesy Jim Fulton, MIT X Consortium]

----------------------------------------------------------------------
~Subject: 139) How do I create a transparent window?

A completely transparent window is easy to get -- use an InputOnly
window. In order to create a window which is *mostly* transparent, you have
several choices:
- the SHAPE extension first released with X11R4 offers an easy way to
make non-rectangular windows, so you can set the shape of the window to fit the
areas where the window should be nontransparent; however, not all servers
support the extension.
- a machine-specific method of implementing transparent windows for
particular servers is to use an overlay plane supported by the hardware. Note
that there is no X notion of a "transparent color index".
- a generally portable solution is to use a large number of tiny
windows, but this makes operating on the application as a unit difficult.
- a final answer is to consider whether you really need a transparent
window or if you would be satisfied with being able to overlay your application
window with information; if so, you can draw into separate bitplanes in colors
that will appear properly.

[thanks to der Mouse, [email protected], 3/92; see also
The X Journal 1:4 for a more complete answer, including code samples for this
last option]

----------------------------------------------------------------------
~Subject: 140) Why doesn't GXxor produce mathematically-correct color values?

When using GXxor you may expect that drawing with a value of black on a
background of black, for example, should produce white. However, the drawing
operation does not work on RGB values but on colormap indices. The color that
the resulting colormap index actually points to is undefined and visually
random unless you have actually filled it in yourself. [On many X servers Black
and White often 0/1 or 1/0; programs taking advantage of this mathematical
coincidence will break.]
If you want to be combining colors with GXxor, then you should be
allocating a number of your own color cells and filling them with your chosen
pre-computed values.
If you want to use GXxor simply to switch between two colors, then you
can take the shortcut of setting the background color in the GC (graphics
context) to 0 and the foreground color to a value such that when it draws over
red, say, the result is blue, and when it draws over blue the result is red.
This foreground value is itself the XOR of the colormap indices of red and
blue.

[Thanks to Chris Flatters ([email protected]) and Ken Whaley
([email protected]), 2/91]

----------------------------------------------------------------------
~Subject: 141) Why does every color I allocate show up as black?

Make sure you're using 16 bits and not 8. The red, green, and blue
fields of an XColor structure are scaled so that 0 is nothing and 65535 is
full-blast. If you forget to scale (using, for example, 0-255 for each color)
the XAllocColor function will perform correctly but the resulting color is
usually black.

[Thanks to Paul Asente, [email protected], 7/91]

----------------------------------------------------------------------
~Subject: 142) Why can't my program get a standard colormap?
I have an image-processing program which uses XGetRGBColormap() to get the
standard colormap, but it doesn't work.

XGetRGBColormap() when used with the property XA_RGB_DEFAULT_MAP does
not create a standard colormap -- it just returns one if one already exists.
Use xstdcmap or do what it does in order to create the standard colormap first.

[1/91; from der Mouse ([email protected])]

----------------------------------------------------------------------
~Subject: 143) Why does the pixmap I copy to the screen show up as garbage?

The initial contents of pixmaps are undefined. This means that most
servers will allocate the memory and leave around whatever happens to be there
-- which is usually garbage. You probably want to clear the pixmap first using
XFillRectangle() with a function of GXcopy and a foreground pixel of whatever
color you want as your background (or 0L if you are using the pixmap as a
mask). [courtesy Dave Lemke of NCD and Stuart Marks of Sun]

----------------------------------------------------------------------
~Subject: 144) How do I check whether a window ID is valid?
My program has the ID of a window on a remote display. I want to check whether
the window exists before doing anything with it.

Because X is asynchronous, there isn't a guarantee that the window
would still exist between the time that you got the ID and the time you sent an
event to the window or otherwise manipulated it. What you should do is send the
event without checking, but install an error handler to catch any BadWindow
errors, which would indicate that the window no longer exists. This scheme will
work except on the [rare] occasion that the original window has been destroyed
and its ID reallocated to another window.

[courtesy Ken Lee ([email protected]), 4/90]

----------------------------------------------------------------------
~Subject: 145) Can I have two applications draw to the same window?

Yes. The X server assigns IDs to windows and other resources (actually,
the server assigns some bits, the client others), and any application that
knows the ID can manipulate the resource [almost any X server resource, except
for GCs and private color cells, can be shared].
The problem you face is how to disseminate the window ID to multiple
applications. A simple way to handle this (and which solves the problem of the
applications' running on different machines) is in the first application to
create a specially-named property on the root-window and put the window ID into
it. The second application then retrieves the property, whose name it also
knows, and then can draw whatever it wants into the window.
[Note: this scheme works iff there is only one instance of the first
application running, and the scheme is subject to the limitations mentioned
in the Question about using window IDs on remote displays.]
Note also that you will still need to coordinate any higher-level
cooperation among your applications.
Note also that two processes can share a window but should not try to
use the same server connection. If one process is a child of the other, it
should close down the connection to the server and open its own connection.

[mostly courtesy Phil Karlton ([email protected]) 6/90]

----------------------------------------------------------------------
~Subject: 146) Why can't my program work with tvtwm or swm?

A number of applications, including xwd, xwininfo, and xsetroot, do not
handle the virtual root window which tvtwm and swm use; they typically return
the wrong child of root. A general solution is to add this code or to use it in
your own application where you would normally use RootWindow(dpy,screen):

/* Function Name: GetVRoot
* Description: Gets the root window, even if it's a virtual root
* Arguments: the display and the screen
* Returns: the root window for the client
*/
#include
Window GetVRoot(dpy, scr)
Display *dpy;
int scr;
{
Window rootReturn, parentReturn, *children;
unsigned int numChildren;
Window root = RootWindow(dpy, scr);
Atom __SWM_VROOT = None;
int i;

__SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False);
XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren);
for (i = 0; i < numChildren; i++) {
Atom actual_type;
int actual_format;
long nitems, bytesafter;
Window *newRoot = NULL;

if (XGetWindowProperty(dpy, children[i], __SWM_VROOT, 0, 1,
False, XA_WINDOW, &actual_type, &actual_format, &nitems,
&bytesafter, (unsigned char **) &newRoot) == Success && newRoot) {
root = *newRoot;
break;
}
}

return root;
}

[courtesy David Elliott ([email protected]). Similar code is in ssetroot, a
version of xsetroot distributed with tvtwm. 2/91]

A header file by Andreas Stolcke of ICSI on export.lcs.mit.edu:contrib/vroot.h
functions similarly by providing macros for RootWindow and DefaultRootWindow;
code can include this header file first to run properly in the presence of a
virtual desktop.

----------------------------------------------------------------------
~Subject: 147) How do I keep a window from being resized by the user?

Resizing the window is done through the window manager; window managers
can pay attention to the size hints your application places on the window, but
there is no guarantee that the window manager will listen. You can try setting
the minimum and maximum size hints to your target size and hope for the best.
[1/91]

----------------------------------------------------------------------
~Subject: 148) How do I keep a window in the foreground at all times?

It's rather antisocial for an application to constantly raise itself
[e.g. by tracking VisibilityNotify events] so that it isn't overlapped --
imagine the conflict between two such programs running.
The only sure way to have your window appear on the top of the stack
is to make the window override-redirect; this means that you are temporarily
assuming window-management duties while the window is up, so you want to do
this infrequently and then only for short periods of time (e.g. for popup
menus or other short parameter-setting windows).

[thanks to der Mouse ([email protected]); 7/92]

----------------------------------------------------------------------
~Subject: 149) How do I make text and bitmaps blink in X?

There is no easy way. Unless you're willing to depend on some sort of
extension (as yet non-existent), you have to arrange for the blinking yourself,
either by redrawing the contents periodically or, if possible, by playing games
with the colormap and changing the color of the contents.

[Thanks to [email protected] (der Mouse), 7/91]

----------------------------------------------------------------------
~Subject: 150)! How do I render rotated text?

Xlib intentionally does not provide such sophisticated graphics
capabilities, leaving them up to server-extensions or clients-side graphics
libraries.
Your only choice, if you want to stay within the core X protocol, is to
render the text into a pixmap, read it back via XGetImage(), rotate it "by
hand" with whatever matrices you want, and put it back to the server via
XPutImage(); more specifically:
1) create a bitmap B and write your text to it.
2) create an XYBitmap image I from B (via XGetImage).
3) create an XYBitmap Image I2 big enough to handle the transformation.
4) for each x,y in I2, I2(x,y) = I(a,b) where
a = x * cos(theta) - y * sin(theta)
b = x * sin(theta) + y * cos(theta)
5) render I2
Note that you should be careful how you implement this not to lose
bits; an algorithm based on shear transformations may in fact be better.
The high-level server-extensions and graphics packages available for X
also permit rendering of rotated text: Display PostScript, PEX, PHiGS, and GKS,
although most are not capable of arbitrary rotation and probably do not use the
same fonts that would be found on a printer.
In addition, if you have enough access to the server to install a font
on it, you can create a font which consists of letters rotated at some
predefined angle. Your application can then itself figure out placement of each
glyph.

[courtesy der Mouse ([email protected]), Eric Taylor
([email protected]), and Ken Lee ([email protected]), 11/90;
Liam Quin ([email protected]), 12/90]

InterViews (C++ UI toolkit, in the X contrib software) has support for
rendering rotated fonts in X. It could be one source of example code.
[Brian R. Smith ([email protected]), 3/91]
Another possibility is to use the Hershey Fonts; they are
stroke-rendered and can be used by X by converting them into XDrawLine
requests. [[email protected], 10/91]

The xrotfont program by Alan Richardson ([email protected])
(posted to comp.sources.x July 14 1992) paints a rotated font by implementing
the method above and by using an outline (Hershey) font.
The xvertext package by Alan Richardson ([email protected]) is a
set of functions to facilitate the writing of vertical and upside-down text.
Version 2.0 was recently released to alt.sources and comp.sources.misc [2/93].

O'Reilly's X Resource Volume 3 includes information from HP about
modifications to the X fonts server which provide for rotated and scaled text.

----------------------------------------------------------------------
~Subject: 151) What is the X Registry? (How do I reserve names?)

There are places in the X Toolkit, in applications, and in the X
protocol that define and use string names. The context is such that conflicts
are possible if different components use the same name for different things.
The MIT X Consortium maintains a registry of names in these domains:
orgainization names, selection names, selection targets, resource types,
application classes, and class extension record types; and several others.
The list as of 7/91 is in the directory mit/doc/Registry on the R5
tape; it is also available by sending "send docs registry" to the xstuff mail
server.
To register names (first come, first served) or to ask questions send
to [email protected]; be sure to include a postal address for
confirmation.

[11/90; condensed from Asente/Swick Appendix H]
----------------------------------------------------------------------

David B. Lewis faq%[email protected]

"Just the FAQs, ma'am." -- Joe Friday
--
David B. LewisTemporarily at but not speaking for Visual, Inc.
day: [email protected]: david%[email protected]

From: [email protected] (Art Mulder)
Newsgroups: comp.windows.x,news.answers,comp.answers
Subject: comp.windows.x: Getting more performance out of X. FAQ
Summary: This posting contains a list of suggestions about what you can do to get the best performance out of X on your workstation -- without buying more hardware.
Date: 16 Feb 93 21:50:34 GMT
Reply-To: [email protected] (Art Mulder)

Archive-name: x-faq/speedups
Last-modified: 1993/2/16

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HOW TO MAXIMIZE THE PERFORMANCE OF X -- monthly posting
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Compiled by Art Mulder ([email protected])

More RAM, Faster CPU's, More disk space, Faster Ethernet... These
are the standard responses you hear when you ask how to improve the
performance of your workstation.

Well, more hardware isn't always an option, and I wonder if more
hardware is always even a necessity.

This "FAQ" list is a collection of suggestions and ideas from different
people on the net on how you can the best possible performance from X
Windows on your workstation, WITHOUT PURCHASING MORE HARDWARE.

Performance is a highly subjective issue. The individual user must
balance `speed' versus `features' in order to come to a personal
decision. Therefore this document can be be expected to contain many
subjective opinions in and amongst the objective facts.

This document is specifically concerned with X. There are of course
many other factors that can affect the performance of a workstation.
However, they are outside the scope of this document.

[ People seriously interested in the whole area of system
performance, might want to look at the O'Reilly Nutshell Handbook
"System Performance Tuning" by Mike Loukides. I'm about 25% of the
way through reading it, and it looks like a well-written
comprehensive treatment of system performance. I'm unaware of any
other similar books. --ed.]

-----------------
Table of Contents
-----------------
! 0. Introduction & Administrivia
1. What about the "Other X FAQ"?
2. Window Managers
! 3. The X Server
Which Server?
! Locking the Server into RAM?
Starting your Server
! Fonts
About the Resources File
Define Your Display Properly
4. Clients
A Better Clock for X
A Better Terminal Emulator for X
5. Miscellaneous Suggestions
Pretty Pictures
A Quicker Mouse
Programming Thoughts
Say What!?
6. Other Sources of Information
! 7. Author & Notes

! = changed since last issue.

-----------------------------
Introduction & Administrivia
-----------------------------

This document is posted each month, on or around the 15th, to the
Usenet news groups comp.windows.x, news.answers, and comp.answers.
If you are reading a copy of this FAQ which is more than a few
months old (see the "Last-modified" date above) you should probably
locate the latest edition, since the information may be outdated.

If you do not know how to get those newsgroups and/or your site does
not receive them and/or this article has already expired, you can
retrieve this FAQ from an archive site.

There exist several usenet FAQ archive sites. To find out more about
them and how to access them, please see the "Introduction to the
news.answers newsgroup" posting in news.answers.

The main FAQ archive is at pit-manager.mit.edu [18.172.1.27]. This
document can be found there in /pub/usenet/news.answers/x-faq/speedups.
If you do not have access to anonymous ftp, you can retrieve it by
sending a mail message to [email protected] with the
command "send usenet/news.answers/x-faq/speedups" in the message body.

-----------------------------
What about the "Other X FAQ"?
-----------------------------

David B. Lewis (faq%[email protected]) maintains the informative and
well written "comp.windows.x Frequently Asked Questions" document.
Its focus is on general X information, while this FAQ concentrates
on performance.

The comp.windows.x FAQ does address the issue of speed, but only with
regards to the X server. The gist of that topic seems to be:
"Use X11R5, it is faster than R4".
(Please see the X FAQ for complete details).

---------------
Window Managers
---------------

There are a lot of window managers out there, with lots of different
features and abilities. The choice of which to use is by necessity a
balancing act between performance and useful features. At this
point, most respondents have agreed upon "twm" as the best candidate
for a speedy window manager.

A couple of generic tricks you can try to soup up your window manger,
is turning off unnecessary things like "zooming" and "opaque move".
Also, if you lay out your windows in a tiled manner, you reduce the
amount of cpu power spent in raising and lowering overlapping
windows. Joe English ([email protected])

I've found that a good font for tiling is 7x13 (aka:
-misc-fixed-medium-r-normal--13-100-100-100-c-70-iso8859-1 ). It is
the biggest font I know of that I can use on my Sun (1152x900 screen)
and still get two 80 column terminal windows side-by-side on the
display with no overlap. Other font suggestions will be accepted.

------------
The X Server
------------

Which Server?
- - - - - - -
Make sure that your server is a proper match for your hardware.
If you have a monochrome monitor, use a monochrome X11 server.

On my Monochrome Sun, I haven't noticed much difference between
the Xsun (colour) server and XsunMono, however it was pointed out to
me that XsunMono is about 800k smaller and therefore should contribute
to less paging.
[ thanks to: Jonny Farringdon ([email protected]),
Michael Salmon ([email protected]) ]

How your server was compiled can also make a difference. Jeff Law
([email protected]) advises us that on a Sun system, X should be
compiled with gcc (version 2.*) or with the unbundled Sun compiler.
You can expect to get "*very* large speedups in the server" by not
using the bundled SunOS compiler. I assume that similar results
would occur if you used one of the other high-quality commercial
compilers on the market.

Locking the Server into RAM?
- - - - - - - - - - - - - - -
Has anyone tried hacking the X server so that it is locked into RAM and
does not get paged? eg: via a call to plock(). Does this help
performance at all? I've had one inquiry on this topic, and a few
pointers to the plock() function call, but no hard evidence from someone
who's tried it. I am not in a position to give it a try.
[thanks to: Eric C Claeys ([email protected]),
Danny Backx ([email protected]),
Juan D. Martin ([email protected]) ]
Starting your Server
- - - - - - - - - - -
Joe English ([email protected]) :
If you start up a lot of clients in your .xsession or whatever, sleep
for a second or two after launching each one. After I changed my
.xclients script to do this, logging in actually took *less* time...
we have a heavily loaded system without much core, though.

This sounds crazy, but I have confirmed that it works!

Warner Losh ([email protected]) provided me with a good explanation of
why this works, which I have summarized here:

When you start up an X server it takes a huge amount of time to
start accepting connections. A lot of initialization is done by
the server when it starts. This process touches a large number of
pages. Any other process running at the same time would fight the
server for use of the CPU, and more importantly, memory. If you
put a sleep in there, you give the Server a chance to get itself
sorted out before the clients start up.

Similarly, there is also a lot of initialization whenever an X
client program starts: toolkits registering widgets, resources
being fetched, programs initializing state and "databases" and so
forth. All this activity is typically memory intensive. Once this
initialization is done ("The process has reached a steady state"),
the memory usage typically settles down to using only a few pages.
By using sleeps to stagger the launching of your clients in your
.Xinitrc , you avoid them fighting each other for your
workstation's limited resources

This is most definitely a "Your Mileage May Vary" situation, as there
are so many variables to be considered: available RAM, local swap
space, load average, number of users on your system, which clients
you are starting, etc.

Currently in my .xinitrc I have a situation like:
(sleep 1; exec xclock ) &
(sleep 1; exec xbiff ) &
(sleep 1; exec xterm ) &
(sleep 1; exec xterm ) &

I've experimented with:
(sleep 1; exec xclock ) &
(sleep 2; exec xbiff ) &
(sleep 3; exec xterm ) &
(sleep 4; exec xterm ) &

I've even tried:
(sleep 2; exec start_X_clients_script ) &
and then in start_X_clients_script I had:
(sleep 1; exec xclock ) &
(sleep 1; exec xbiff ) &
(sleep 1; exec xterm ) &
(sleep 1; exec xterm ) &

[ The idea with this last one was to make sure that xinit had
completely finished processing my .xinitrc, and had settled down
into a "steady state" before the sleep expired and all my clients
were launched. ]

All of these yielded fairly comparable results, and so I just stuck with
my current setup, for its simplicity. You will probably have to
experiment a bit to find a setup which suits you.

Fonts
- - -
Loading fonts takes time and RAM. If you minimize the number of fonts
your applications use, you'll get speed increases in load-up time.

One simple strategy is to choose a small number of fonts (one small, one
large, one roman, whatver suits you) and configure all your clients -- or
at least all your heavily used clients -- to use only those few fonts.
Client programs should start up quicker if their font is already loaded
into the server. This will also conserve server resources, since fewer
fonts will be loaded by the server.
[ Farrell McKay ([email protected]),
Joe English ([email protected]) ]

eg: My main xterm font is 7x13, so I also have twm set up to use 7x13
in all it's menus and icons etc. Twm's default font is 8x13. Since
I don't normally use 8x13, I've eliminated one font from my server.

Oliver Jones ([email protected]):
Keep fonts local to the workstation, rather than loading them over nfs.
If you will make extensive use of R5 scalable fonts, use a font server.

About the Resources File
- - - - - - - - - - - - -

Keep your .Xresources / .Xdefaults file small. Saves RAM and saves
on server startup time. Joe English ([email protected])

One suggestion:

In your .Xdefaults (.Xresources) file, try putting only the minimum
number of resources that you want to have available to all of your
applications. For example: *reverseVideo: true

Then, separate your resources into individual client-specific
resource files. For example: $HOME/lib/app-defaults. In your
.login file set the environment variable XUSERFILESEARCHPATH:
setenv XUSERFILESEARCHPATH $HOME/lib/app-defaults/%N

[ The "comp.windows.x Frequently Asked Questions" FAQ contains
an excellent explanation of how these environment variables work.
--ed.]

So, when xterm launches, it loads its resources from
.../app-defaults/XTerm. Xdvi finds them in .../app-defaults/XDvi,
and so on and so forth. Not all clients follow the same
class-naming convention, so you may have some fun figuring out what
to call the resource file (xterm? Xterm? XTerm?). In general, try
following the standard XXxxx pattern first.

This is all documented in the Xt Specification (pg 125 & 666).
[Thanks to: Kevin Samborn ([email protected])
and Michael Urban ([email protected]).
Kevin is willing mail his setup files to inquirers.]

This method of organizing your personal resources has the following
benefits:

- Easier to maintain / more usable.

- Fewer resources are stored in the X server in the RESOURCE_MANAGER
property. As a side benefit your server may start fractionally
quicker, since it doesn`t have to load all your resources.

- Applications only process their own resources, never have to sort
through all of your resources to find the ones that affect them.

It also has drawbacks:

- the application that you are interested in has to load an
additional file every time it starts up. This doesn't seem to
make that much of a performance difference, and you might
consider this a huge boon to usability. If you are modifying an
application's resource database, you just need to re-run the
application without having to "xrdb" again.

- xrdb will by default run your .Xdefaults file through cpp. When
your resources are split out into multiple resource files and
then loaded by the individual client programs, they will not.
WATCH OUT FOR THIS!!

I had C style comments in my .Xdefaults file, which cpp stripped
out. When I switched to this method of distributed resource
files I spent several frustrating days trying to figure out why
my clients were not finding their resources. Xt did *NOT*
provide any error message when it encountered the C style
comments in the resource files, it simply, silently, aborted
processing the resource file.

The loss of preprocessing (which can be very handy, e.g. ``#ifdef
COLOR'' ...) is enough to cause some people to dismiss this
method of resource management.

- You may also run into some clients which break the rules. For
example, neither Emacs (18.58.3) nor Xvt (1.0) will find their
resources if they are anywhere other than in .Xdefaults.

- when starting up a client on a machine that does not share files
with the machine where your resources are stored, your client
will not find its resources. Loading all your resources into the
server will guarantee that all of your clients will always find
their resources. Casey Leedom ([email protected])

A possible compromise suggestion that I have (and am planning on trying)
is to put resources for all my heavily used clients (eg: xterm) into my
.Xdefaults file, and to use the "separate resources files" method for
clients that I seldom use.

Define Your Display Properly
- - - - - - - - - - - - - - -

Client programs are often executed on the same machine as the server. In
that situation, rather than setting your DISPLAY environment variable to
":0.0", where is the name of your workstation, you
should set your DISPLAY variable to "unix:0.0" or ":0.0". By doing this
you access optimized routines that know that the server is on the same
machine and use a shared memory method of transferring requests.
[thanks to Patrick J Horgan ([email protected])]

See the _DISPLAY NAMES_ section of the X(1) man page for further
explanation of how to properly set your display name.

"I don't think it's stock MIT, but (at least) Data General and HP have
libraries that are smart enough to use local communication even when
the DISPLAY isn't set specially."
Rob Sartin ([email protected])

-------
Clients
-------

If you only have a few megabytes of Ram then you should think
carefully about the number of programs you are running. Think also
about the _kind_ of programs you are running. For example: Is there
a smaller clock program than xclock?

Unfortunately, I haven't really noticed that programs advertise how large
they are, so the onus is on us to do the research and spread the word.

[ Suggestions on better alternatives to the some of the standard clients
(eg: Xclock, Xterm, Xbiff) are welcome. --ed.]

I've received some contradictory advice from people, on the subject
of X client programs. Some advocate the use of programs that are
strictly Xlib based, since Xt, Xaw and other toolkits are rather
large. Others warn us that other applications which you are using
may have already loaded up one or more of these shared libraries. In
this case, using a non-Xt (for example) client program may actually
_increase_ the amount of RAM consumed.

The upshot of all this seems to be: Don't mix toolkits. That is, try
and use just Athena clients, or just Xview clients (or just Motif
clients, etc). If you use more than one, then you're dragging in
more than one toolkit library.

Know your environment, and think carefully about which client
programs would work best together in that environment.

[Thanks to: Rob Sartin ([email protected]),
Duncan Sinclair ([email protected] | [email protected]) ]

A Better Clock for X
- - - - - - - - - - -

1) xcuckoo
suggested by: Duncan Sinclair ([email protected])
available: on export.lcs.mit.edu

Xcuckoo displays a clock in the title bar of *another* program.
Saves screen real estate.

2) mclock
suggested by: der Mouse ([email protected])
available: larry.mcrcim.mcgill.edu (132.206.1.1) in /X/mclock.shar

Non Xt-based. Extensively configurable. it can be made to look
very much like MIT oclock, or mostly like xclock purely by changing
resources.

Of course, the ultimate clock --- one that consumes no resources, and
takes up no screen real estate --- is the one that hangs on your wall.
๐Ÿ™‚

A Better Terminal Emulator for X
- - - - - - - - - - - - - - - - -

From the README file distributed with xterm:

+-----
| Abandon All Hope, Ye Who Enter Here
|
| This is undoubtedly the most ugly program in the distribution.
| ...
+-----

Ugly maybe, but at my site it's still the most used. I suspect that
xterm is one of the most used clients at many, if not most sites.
Laziness? Isn't there a better terminal emulator available? See below.

If you must use xterm, you can try reducing the number of saveLines
to reduce memory usage. [ Oliver Jones ([email protected]),
Jonny Farringdon ([email protected]) ]

1) Xvt
suggested by: Richard Hesketh ([email protected]) :
available: export.lcs.mit.edu in /contrib/xvt-1.0.tar.Z

"...if you don't need all the esoteric features of xterm, then get
hold of xvt ... it was written here just to save swap space as
xterm is rather a hog! "

I've obtained and evaluated 'xvt' and it does seem to me to be
noticeably faster than xterm, while yet coming off as a full
featured "clone" of xterm -- you don't even have to rename your
xterm resources as xvt pretends to be XTerm.

What I dislike about xvt (in its current form) is that you can't
bind keys, as you can in xterm. This has driven me back to xterm,
as I have fkeys configured to let me scroll back through saved lines
without using the mouse & the scrollbar. I've heard that there are
versions of Xvt with this feature, but I've not found any yet.

2) mterm suggested by: der Mouse ([email protected])
available: larry.mcrcim.mcgill.edu (132.206.1.1) in
/X/mterm.src/mterm.ball-o-wax.

"I also have my own terminal emulator. Its major lack is
scrollback, but some people like it anyway."

-------------------------
Miscellaneous Suggestions
-------------------------

Pretty Pictures
- - - - - - - -
Don't use large bitmaps (GIF's, etc) as root window backgrounds.

- The more complicated your root window bitmap, the slower the server
is at redrawing your screen when you reposition windows (or redraw, etc)

- These take up RAM, and CPU power. I work on a Sun SPARC and I'm
conscious of performance issues, I can't comprehend it when I see
people with a 4mb Sun 3/60 running xphoon as their root window.

I'll let someone else figure out how much RAM would be occupied by
having a full screen root image on a colour workstation.

- If you're anything like me, you need all the screen real estate
that you can get for clients, and so rarely see the root window anyway.

[ Thanks to Qiang Alex Zhao ([email protected])
for reminding me of this one. --ed.]

A Quicker Mouse
- - - - - - - -
Using xset, you can adjust how fast your pointer moves on the screen
when you move your mouse. I use "xset m 3 10" in my .xinitrc file,
which lets me send my pointer across the screen with just a flick of
the wrist. See the xset man page for further ideas and information.

Hint: sometimes you may want to *slow down* your mouse tracking for
fine work. To cover my options, I have placed a number of different
mouse setting commands into a menu in my window manager.

e.g. (for twm) :
menu "mouse settings" {
"Mouse Settings:"f.title
" Very Fast"! "xset m 7 10 &"
" Normal (Fast)"! "xset m 3 10 &"
" System Default (Un-Accelerated)"! "xset m default &"
" Glacial"! "xset m 0 10 &"
}

Programming Thoughts
- - - - - - - - - - -
Joe English ([email protected]) :
To speed up applications that you're developing, there are tons of
things you can do. Some that stick out:

- For Motif programs, don't set XmFontList resources for individual
buttons, labels, lists, et. al.; use the defaultFontList or
labelFontList or whatever resource of the highest-level manager
widget. Again, stick to as few fonts as possible.

- Better yet, don't use Motif at all. It's an absolute pig.

- Don't create and destroy widgets on the fly. Try to reuse them.
(This will avoid many problems with buggy toolkits, too.)

- Use a line width of 0 in GCs. On some servers this makes a HUGE
difference.

- Compress and collapse multiple Expose events. This can make the
difference between a fast application and a completely unusable
one.

Francois Staes ([email protected]) :
Just a small remark: I once heard that using a better malloc
function would greatly increase performance of Xt based
applications since they use malloc heavily. They suggested trying
out the GNUY malloc, but I didn't find the time yet. I did some
tests on small programs just doing malloc and free, and the
differences were indeed very noticeable ( somewhat 5 times faster)

[ Any confirmation on this from anyone? --ed.]

Say What!?
- - - - - -
Some contributors proposed ideas that seem right off the wall at first:

David B. Lewis (by day: [email protected], by night: david%[email protected]) :
How about this: swap displays with someone else. Run all your programs
on the other machine and display locally; the other user runs off your
machine onto the other display. Goal: reduce context switches in the
same operation between client and server.

I'm not in a situation where I can easily try this, but I have received
the following confirmation...

Michael Salmon ([email protected]):
I regularly run programs on other machines and I notice a big
difference. I try to run on a machine where I will reduce net usage
and usually with nice to reduce the impact of my intrusion. This
helps a lot on my poor little SS1+ with only 16 MB, it was
essential when I only had 8 MB.

Casey Leedom ([email protected]) :
[The X11 Server and the client are] competing for the same CPU as
your server when you run it on the same machine. Not really a
major problem, except that the X11 client and the server are in
absolute synchronicity and are context thrashing.

Timothy H Panton ([email protected]) :
Firstly it relies on the fact that most CPU's are mostly idle, X's
cpu usage is bursty. so the chances of you and your teammate
doing something cpu-intensive at the same time is small. If they
are not then you get twice the cpu+memory available for your
action.

The second factor is that context switches are expensive, using 2
cpu's halves them, you pay a price due to the overhead of going
over the network, but this is offset in most cases by the improved
buffering of a network (typically 20k vs 4k for a pipe), allowing
even fewer context switches.

----------------------------
Other Sources of Information
----------------------------

Adrian Nye ([email protected]):
A lot more tips on performance are in the paper "Improving X
Application Performance" by Chris D. Peterson and Sharon Chang, in
Issue 3 of The X Resource.

An earlier version of this paper appeared in the Xhibition 1992
conference proceedings.

This paper is absolutely essential reading for X programmers.

[Seems I've got some competition. ๐Ÿ™‚ --ed.]

Also, Volume 8 in O'Reilly's X Window System Series, ``X Window System
Administrator's Guide'' is a book all X administrator's should read.

--------------
Author & Notes
--------------
This list is currently maintained by Art Mulder ([email protected])

Suggestions, corrections, or submission for inclusion in this list
are gladly accepted. Layout suggestions and comments (spelling
mistak's too! ๐Ÿ™‚ are also welcome.

Currently I have listed all contributors of the various comments and
suggestions. If you do not want to be credited, please tell me.

speedup-x-faq is copyright (c) 1993 by Arthur E. Mulder

You may copy this document in whole or in part as long as you don't
try to make money off it, or pretend that you wrote it.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--
...art mulder ( [email protected] ) | "Do not be conformed to this world,
Department of Computing Science | but be transformed by the renewal
University of Alberta, Edmonton, Canada | of your mind, ..." Romans 12:2



 December 26, 2017  Add comments

Leave a Reply