'\"macro stdmacro
.if n .pH g6.xdemos @(#)xdemos	40.2 of 12/29/89
.ig
Revised: D. Bodnar 9/7/89
format -dqm4 -man6 -rs1 xdemos.6
..
.\" @(#)xdemos.6 9.5 88/06/14 Copyright 1987 Sun Micro
.nr X
.if \nX=0 .ds x} XDEMOS 6 "14 June 1988" "\&"
.if \nX=1 .ds x} XDEMOS 6 "14 June 1988"
.if \nX=2 .ds x} XDEMOS 6 "" "\&"
.if \nX=3 .ds x} XDEMOS "" "" "\&"
.TH \*(x}
.IX xdemos#(6) "" "\fIxdemos\fP(6) \(em X Window System demonstration"
.ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2
.ds Sd \s-2Ne\h'-0.2n'WS\s+2
.ds Xn X11/Ne\h'-0.2n'WS
.ds Pm \*(Sd Programmer's Guide
.IX demos "xdemos(6) - X Window System demos" "" "\fIxdemos\fP(6) \(em X Window System demonstration"
.SH NAME
xdemos \- X Window System demonstration
.SH SYNOPSIS
\fBX Demos\fP menu item in the \*(Sd root menu
.SH DESCRIPTION
The \*(Sd \fBX Demos\fP are some programs that demonstrate a
small subset of the X Window System (version 10) protocol running under
\*(Sd.  The X server is written almost entirely in the \*(Ps language;
the code is contained in the file \fI$NEWSHOME/lib/NeWS/X10.ps\fP.
.LP
The \fBX Demos\fP pull-right menu has two items: \fBRun a Demo\fP and
\fBKill X Server\fP.  If the X server is not running, the second menu
item will have no effect.
.SH "RUNNING DEMOS FROM THE MENU"
In order to start an X demo from the \*(Sd menu, you must pull right from the
\f3Run a Demo\fP menu item.  This reveals a number of demo programs:
\fIAnalog Clock and Load Average.\fP
Selecting one of these starts up the
corresponding X program.  If the X Server has not yet been started, it will
be started automatically.  The demonstration programs do not bring up
windows in the standard \*(Sd style; they instead conform to the
standard X style, which is as follows.  First, the name of the program
appears in a small window in the upper left-hand corner of the screen.  Then,
a flickering rectangle or square appears at the current cursor location.
This rectangle tracks the motion of the cursor.  At this point, you
can do one of three things:

.RS .5i
\fBClick the left button.\fP  This brings up a window of default size at
the current cursor location.

\fBDrag with the middle button.\fP  If you hold down the middle
button, drag the mouse, and then release the middle button, you can drag
out a rubber-band rectangle that specifies the window's location and size.

\fBClick the right button.\fP  This brings up a window of default size
at the default location.
.RE

If you select \fBKill X Server\fP while any X demos are
active, they will be killed along with the server.
.SH "WINDOW MANAGEMENT"
In the X Window System, the only way to move or resize windows is to use a
window manager program.  Unfortunately, no X window managers work
under \*(Sd as yet.  In order to provide window management facilities to X
windows running under \*(Sd, a special window management menu is made
available in all X windows.  This menu is accessible from the right mouse
button when the cursor is over an X window
and it contains the following items: \fIMove, Redisplay, Resize,
\fPand\fI Quit.\fP  These functions should be self-explanatory.
.SH "RUNNING DEMOS FROM A SHELL"
In order to run X demos from a shell (on the local machine or on a remote
machine) one must set the DISPLAY environment variable properly.  The \*(Sd X
server listens for connections on port 5901, which means that the DISPLAY
variable should contain the string ``hostname:1'' so that X clients will
connect to the proper location.  After DISPLAY is set properly, one can
start up X demos in the normal X fashion.
.SH "SEE ALSO"
newsdemos(6)
.br
.I "\*(Nm"
.SH BUGS
No byte swapping is done.
.sp
Only a small subset of X requests is implemented.  In particular, only
programs like \fIxclock\fP and \fIxload\fP.
.sp
The \*(Sd X Server accepts only internet-domain connections.  UNIX-domain
connections are not supported.
.sp
Running the X demos from the menu can freeze the
screen and input if you have a line in your \f4.Xdefaults\fP file similar
to the following:
.LS 4 8
\&.MakeWindow.Freeze:   on
.LE
Turning on this option causes X clients to issue a slightly different
set of requests, two of which the X demo do not handle.
The work-around is to change the line in \f4.Xdefaults\fP to:
.LS 4 8
\&.MakeWindow.Freeze:   off
.LE
.LP
\f4$NEWSHOME/lib/NeWS/demomenu.ps\fP contains
an error which causes the X demos to not run sometimes.
The work-around is to replace the following lines in
\f4$NEWSHOME/lib/NeWS/demomenu.ps\fP:
.LS 4 8
.ft H
% do "setenv DISPLAY localhost:1"
(DISPLAY) (localhost:1) putenv
.LE
with:
.LS 4 8
.ft H
% do "setenv DISPLAY `hostname`:1"
(DISPLAY) localhostname (:1) append putenv
.LE
.LP
The following is not really a bug as much as an exposure of the \*(Sd/X
interface. X demo windows will not respond to `Repaint All'
requests from the root menu, or `Zap All', `Open All' requests
from the `All Windows' menu.  The `Repaint All' problem is due to a known
inadequacy of the current X emulator demo package.  'Zap All' and other
selections from the `All Windows' menu have no effect since  X and \*(Sd
exist, in essence, in two different worlds.
.SH TRADEMARK
\*(Ps is a registered trademark of Adobe Systems Inc.
