CHAPTER 10: WINDOW ENVIRONMENTS
back to the Computing Guide Contents


A windowing system is a software package that displays multiple windows simultaneously on a single display device, and directs keyboard and mouse input into individual windows. Windowing systems have window managers that perform a variety of functions. The window manager allows you to change the characteristics of individual windows such as size or position. The window manager directs input from the keyboard and mouse into an active window and handles interaction between windows, such as cutting and pasting between windows. Most windowing systems, including the X Window System, share these characteristics. The X Window System was designed to operate in a distributed computing environment; it allows you to open and work in a number of windows, accessing various machines across the network. This chapter contains information on two X Window System environments, Motif and Open Windows. Information on the following topics is included.


10.1 The X Window System


10.1.1 Introduction

The X Window System is a window environment that can access a variety of computers on a network. It is based on a client-server model where the X server runs on the display device (the X terminal or workstation), and application programs, called clients, run on either the local machine or on machines connected by a network.

With the X Window System, you can run multiple applications simultaneously in a number of windows on one display device. These applications may run on a variety of hardware platforms on the network. For example, if you are logged on at a workstation's console running the X server, you might have one window containing a text editing session running on the workstation at which you are sitting, another window running a program on , and a third window displaying graphics from another workstation. Such a windowing environment can increase your productivity, but note that network and workstation performance impact the windowing environment. Conversely, network and workstation loads increase proportionally with the number of X processes. At a certain point, running too many X clients at once will negatively impact your work.

The X Window System is a collection of many server and client programs that you can configure to meet your own needs and tastes. A number of configuration files exist to configure and start up the applications you require. This chapter describes the most important of these files. The example files can be found in /usr/local/skel. There are too many X client programs available to describe them all here, but this chapter mentions a few of the most commonly used programs. This chapter gives a brief overview; the complete X documentation includes many volumes of manuals. Because of the complex interactions between the server client programs, information you need may be spread across a number of manuals.

10.1.2 Configuration Files

The .Xdefaults file

The .Xdefaults file is an X Window System resource file. X resource files modify the default characteristics of X applications. When you start an X application, it reads the .Xdefaults file in your home directory. If it does not find this file in your directories, it reads the system X resource file. The application then modifies its default characteristics from the information in the .Xdefaults file. You need an .Xdefaults file only if you want to modify the default characteristics of an X application. If you choose to have a .Xdefaults file, you only need entries for the specific applications you wish to modify. Note that all X applications refer to the same X resource file. Therefore, the parameters you can set for a specific X application are discussed in the application's documentation. For example, to control the cursor color in an individual window (xterm), refer to the xterm documentation or man pages for the correct syntax. A sample of the contents of this file is shown below.
     #ifdef COLOR 
     *foreground:                    Black
     *background:                    Bisque
     *highlight:                     Red 
     #endif
     Mwm*systemMenu:                 RootMenu
     Mwm*keyboardFocusPolicy:        explicit
     Mwm*background:                 #E1E1BFBFA3A3
     Mwm*foreground:                 #000000000000
     Mwm*activeBackground:           #878763634747
     Mwm*activeBottomShadowColor:    #5E5E42422828
     Mwm*activeForeground:           #000000000000
     Mwm*activeTopShadowColor:       #ABAB79795555
     Mwm*bottomShadowColor:          #B2B284845D5D
     Mwm*topShadowColor:             #F3F3D7D7C1C1
     Mwm*menu*foreground:            navy
     Mwm*menu*background:            lightblue
     Mwm*menu*topShadowColor:        cyan
     Mwm*menu*bottomShadowColor:     darkturquoise
     Mwm*iconImageBackground:        #B6B676767171         
     Mwm*iconImageBottomShadowColor: #808052524E4E         
     Mwm*iconImageForeground:        #D6D6AAAA9797         
     Mwm*iconImageTopShadowColor:    #C8C882827D7D
     xterm*bodyFont:                 10x20         
     xterm*cursorColor:              aquamarine         
     xterm*pointerColor:             red         
     xterm*background:               LightBlue         
     xterm*foreground:               black         
     xterm*scrollBar:                on
     xterm*translations:#override<Key>F10:string("uptime") string(0x0d) \n\             
     <Key>F11:string(0x1b) \n\

The .xinitrc File

The .xinitrc file contains the commands to start up X Window clients when the startx command is used to initiate the MIT X Window System.  startx is often used to start the X Window system on the Sun workstations. If you use startx on the Sun workstations, you must have a .xinitrc file. You do not need this file on the DEC or SGI workstations. Following is an example.
        #
        # .xinitrc
        #
        # Set the root window background color
        xsetroot -solid Aquamarine
        # Start the window manager
        mwm &
        # Start up an xterm
        xterm -fn 9x15 -g 80x24 -sb
        # Exit from xterm exits this script and kill X
        exit

The .xsession File

The .xsession file contains the commands to start X Window clients when the X Display Manager program, xdm, is used to start the X Window system. To access the Sun or DEC workstations from their consoles, you do not need this configuration file. For access to the SGI workstations, the file is optional. Following is an example of what to include in this file.

10.1.3 Window Utilities

The resize Utility

The resize utility resets the terminal settings to the current window size. You often need to use this command when running X and xterm clients across several machines. For instance, if the editor is not behaving properly, executing resize may correct the problem.
        Syntax: resize
on Solaris systems you must specify

        eval 'resize'

The xhost Utility

The xhost utility adds hosts to, and deletes hosts from, the list of machines that are allowed to make connections to the X server.
        Syntax: xhost [+-]hostname
For example, assuming you are logged in to the host walnut, enter the following commands to allow access by laurel.
        >xhost +laurel 
        >telnet  laurel 
        (Login to laurel)
        >setenv DISPLAY walnut:0.0
This information is not stored in a file, and must be entered at your next login session if needed.

The xmodmap Utility

The xmodmap utility modifies the keyboard of an X device, console or X terminal. For example,
        xmodmap .xmodmaprc
.xmodmap is a file that contains keyboard configuration information. This file is read by the xmodmap program to define keyboard bindings for workstation keyboards. The following example sets the F11 and F12 keys to generate the escape and F12 character sequences useful in vi and emacs.
        keycode 10 = Escape         keycode 11 = F12
For some Emacs applications, you may also need to define the F13 key.
        keycode 12 = F13

The xrdb Utility

The xrdb utility shows and sets X resources. For example,
        xrdb -q

The xset Utility

The xset utility shows and sets X display options. For example,
        xset q

The xterm Utility

The xterm utility is a client/application program that emulates a text or graphics terminal. There are numerous options to control various attributes, such as size and font. The following example generates an xterm of the size 80x24 (typical ASCII terminal), with a large font called 10x20 and a scroll bar.
        xterm -fn 10x20 -g 80x24 -sb &
For a smaller font, try -fn 9x15.

The xwd and xwud Utilities

These utilities dump and display the contents of an X Window.
        Syntax: xwd -out filename 

        Syntax: xwud -in filename

10.1.4 Window Managers

mwm

The Motif Window Manager, mwm, is responsible for managing X server events and all X clients associated with an X server. Mwm allows you to move, resize, and iconify windows. For detailed information on manipulating windows, see the OSF/Motif User's Guide.

The window manager dictates the "look and feel" of a windowing system. mwm gives window borders and buttons a three-dimensional appearance. Note that the window manager places the borders and buttons around client windows. If these do not appear, mwm is not running. To correct this problem, first try to restart the window manager by typing mwm &. If this fails, restart the X environment by logging off completely and then logging on again.

A number of window managers exist, such as uwm, twm, olwm, and dxwm. However, mwm is particularly well suited to our computing environment because it is available on most hardware platforms, including SGI, DEC, Sun, HP, IBM and Cray, and it handles color and focus more uniformly than other window managers.

The .mwmrc File

The .mwmrc file is read by the Motif Window Manager. This file controls the menus and other operations of mwm. An example of this file is shown below.

On-line Information

Hardcopy References



Return to top of page

10.2 Open Windows


10.2.1 Introduction

OpenWindows is a Sun user environment based on the OPEN LOOK Graphical User Interface (GUI) and built on X11/NeWS. X uses a "client-server" model; the client (your program) communicates with the server using the X protocol. It is the server that actually creates the display on the screen. NeWS, an alternative protocol based on PostScript, was developed around the same time as the X protocol, but has the advantage of measuring in inches rather than pixels, so that changing screens does not change the size of what is displayed. In this context, a GUI is a set of specifications for the "look and feel" of the user interface. It provides a guide for developers and users to maintain consistency and assure that users can successfully apply their previous experience to using new programs.

Motif and OPEN LOOK, two major standards in workstation GUIs, were developed in the 1980s. The differences between these GUIs become apparent when you compare their window managers (mwm for Motif, and olwm or olvwm for OPEN LOOK). However, these standards are just style guides, independent of the underlying machines.

OpenWindows is a user environment, which means that it includes a variety of utilities you can use. The primary limitation of OpenWindows as a general working environment is that it is specific to Sun systems. Because of the specific protocol required for Open Windows, you may encounter problems using it on an X terminal device.

10.2.2 Starting Open Windows

1.      Check that the environmental variable OPENWINHOME is set by entering

        printenv OPENWINHOME

2.      If this variable is not set, edit your .cshrc file 
        and add the following line

        setenv OPENWINHOME /usr/openwin 

3. Add the following to your PATH variable
        $OPENWINHOME
4. Add the following to your LD_LIBRARY_PATH variable
        :$OPENWINHOME/lib/X11:$OPENWINHOME/lib:$OPENWINHOME/bin
Note: Remember, if you add lines to your .cshrc, you can activate these commands with the command source .cshrc.
4.      Set DISPLAY to point to your screen (e.g., walnut.mmm.edu).
        setenv DISPLAY walnut

5.      Go to your home directory (cd) and enter
        openwin

10.2.3 Exiting Open Windows

Using the right mouse button, bring up the background menu. Select exit.

10.2.4 Spot Help

If you need information about an item on the screen, place the mouse pointer on that item and press help. A window appears containing information about that item. You can also access Help Handbooks from the workstation.

10.2.5 File Manager

File manager provides a graphical display of the file and directory structure in your file system. Each file appears as an icon that you can open by double-clicking SELECT on that icon.

Hardcopy References



Return to top of page

Copyright © UCAR 1998 - Disclaimer - mmminfo@ncar.ucar.edu
Last Modified: 1 December 2002