[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide

Understanding Windows

The organization of windows on the display is often compared to the organization of pieces of paper on the surface of a desk. You can arrange papers on a desktop in any number of ways, including stacking papers one on top of another so that one paper obscures the visibility of all, or portions, of other papers. You can also file papers, discard them, or add new papers to the collection.

Unlike the pieces of paper on a desk, however, you can change the contents, size, and other attributes of windows. Windows conceptually can extend beyond the screen, which means that portions of the window will not be visible. The number and content of windows on your screen will vary, depending on what applications are running at any given moment.

Window Hierarchy

Windows are organized into a hierarchy. The entire screen, analogous to the desktop, is covered by the root window, which cannot be removed. Other windows appear within the root window and are known as its children. Every window except the root window has a parent. Windows that have the same parent are considered siblings.

In Motif applications, there are three basic types of windows:

  1. Primary windows

  2. Secondary windows

  3. Menu windows

    Primary windows organize the contents of the application. Primary windows serve as parent windows for other windows in an application. They usually are children of the root window.

    Motif applications use secondary windows for conveying information to or requesting information from the user. A secondary window always has a parent window, either a primary window or another secondary window.

    Menu windows, or simply Menus, display temporary lists of choices. A menu window always relates to a parent window, either a primary window, a secondary window, or another menu.

  4. Window Geometry

    The position and size of a window on a display is referred to as the window geometry. The height and width of a window are usually expressed in pixels (from picture elements). However, an application may use units that make sense for that application, such as the number of characters or lines.

    Like the points on a graph, each window has its own coordinates. The window's horizontal position is expressed as x. The window's vertical position is expressed as y. The x,y coordinate position of each window's upper left corner, or origin, is (0, 0). The x coordinate increases as you move to the right within the window, and the y coordinate increases as you move down within the window. Figure 1-1 illustrates the system of window coordinates.

    Figure 1. Window Coordinates.

    View figure.

    Relative to the Root Window, Window A's origin (upper left corner) is placed at coordinate (50, 100). Relative to Window A, however, this is coordinate (0, 0). Chapter 5 describes how to specify these coordinates for windows in Motif applications.

    Interacting with Windows

    Using a client program called a window manager, you can move windows around, remove them from view, change their sizes, and rearrange their stacking order. Motif includes its own window manager, the Motif Window Manager (mwm). You can interact with client applications programs, including the window manager, with either a pointing device such as a mouse or the keyboard. There are keystrokes that correspond to mouse button actions. Chapter 2 describes mwm in detail.

    [ Previous | Next | Contents | Glossary | Home | Search ]