Chapter 2: Introduction to Window Systems and X Windows

This chapter introduces you to the basic concepts of window systems in general and to the window system used in our computing environment. While some of the basics are covered in chapter 1, you should read this before you start to work on your first lab.

Window systems have a number of common features. If you are already acquainted with another window system such as tvtwm or fvwm2, some of this information will be familiar. However, unless you are already acquainted with CDE, you should at least skim the section on the basic features of window systems, and read through the rest of the chapter.

Solaris 8 Desktop

Using Multiple Windows

When two or more windows share the same space on the screen, the windows are essentially stacked on top of each other. This is one of the reasons your working environment is called a ``desktop''.

CDE uses the term focus to explain how it knows where input from the keyboard should go. There are two options for this: either the input should go to the window the mouse is in or the input should go to the front window (the window at the top of the desktop) regardless of where the mouse is at the time. The default mode is ``click to focus'', so input goes into the window last clicked, irrespective of the pointer's location. This can be changed through CDE's Style Manager .

The Anatomy of a Window

Most of the CDE windows you will use have the same basic structure as the Terminal and XEmacs windows you have already seen and consist of three or four separate areas, depending on the type of window: the body, which holds the text you are editing; the title bar; the frame; and sometimes one or two scroll bars. While the purpose of the window's body is self-evident; the other parts of the window require some explanation.

The Title Bar

Title bars usually have three features: the title bar itself, a close box, and a resize box. The title bar itself distinguishes the window you are working in from the other open windows. The title bar also can be used as a handle for moving the window around the desktop. Under X11, you can move a window by clicking on the title bar and holding down either the left or middle mouse button while moving the mouse. X11 also lets you pull and push a window between the front and back of the desktop by clicking in the title bar. Clicking with either the right or the left mouse button on the title bar of the front-most window on the screen pushes it behind all the other windows. Clicking with those buttons on a window other than the front-most window pulls the window to the front of the screen.

The Close Box

The close box is usually on the left side of the title bar. Clicking the close box will show a menu offering a number of options, including moving the window, minimizing it, maximizing it, moving it to another workspace, and closing the window.

The Maximize and Minimize Boxes

The resize box lets you grow a window to occupy the entire screen. The minimize box will iconify the window, turning it into an icon. You can double-click an iconified window to reopen it.

The Scroll Bar

When there is more information than can fit in the current window it is possible to use the scroll bar to look at the data that does not fit. If you think of the window as a window through which you view a particular document, the scroll bar becomes the tool you use to look at the different parts of the document. Generally, the scroll bar runs the length or width of the window. In CDE, scroll bars are most commonly seen on Terminal windows. The Terminal scroll bar is the column on the right side of the window.

The Frame

The outline of the window is called the frame or border. In CDE, a right mouse-click on the frame will present you with the same menu that you see when clicking in the close box.

Icons

An icon is a small picture of an object and can be used to manipulate that object. Icons can be used to represent files, directories and devices (such as printers or disks), among other things. Under the default environment in CDE, an icon directly on the desktop represents a closed window. As noted above, you can iconify a window by clicking on the minimize box. Double-clicking on an icon with the left mouse button opens the window the icon represents or de-iconifies it.

Menus are lists of commands. One of the biggest advantages to menus is that you do not actually have to recall the specific wording of commands; instead, you only have to recognize them in the menu. Commands which are related in some way will usually be in the same menu.

The most significant menu in CDE is the Workspace Menu, which is raised by pointing to the background and clicking the right mouse button. Try some of the options there to see what is available.

Various applications obviously have their own menus.

Manipulating Text

Window systems and the mouse make it easier to edit text files. Without a mouse, moving the position of the text cursor requires using keyboard commands to navigate through the file. With a mouse, a single click can move the text cursor to its new position. Some older systems made allowances for copying text from one place in a file to another; however, window systems make this much easier. If you use the mouse to select a chunk of text in a Terminal or XEmacs window, that text will be copied automatically into the computer's memory. Once the computer has this internal copy of the text, you can paste that text into another location by moving the text cursor and clicking the middle mouse button. This makes it easy, for example, to send a copy of what you see in your Terminal window to an operator if you are having a problem.

More Information About X

When looking for information, the first place to check is under the Help subpanel of the CDE front panel.

The definitive reference to The X Window System and command-line programs is the UNIX system manual, described in the 'man' command. Each program/library is described there as exhaustively as the author decided it needed to be described.

For more information on the X Windows System please refer to it's homepage X.org and their wiki.

The 'man pages' can also be located online and are searchable. Man pages online