Using the X Window System > Chapter 7 The Window ManagerWorking with Icons |
|
Icons provide a handy way to straighten up a cluttered workspace. An icon image (a bitmap) is the actual graphic illustration of the icon. An image can come from any one of the following three sources, listed in order of precedence:
The window manager searches for an icon image in the order shown above. It stops searching when it finds the first image that meets the selection criteria. The resource useClientIcon lets you interchange the precedence of user-supplied icon images and client-supplied icon images. The default value is "False." When the resource is set to "True," client-specified icon images have precedence over user-supplied icon images. By default, the window manager places icons in the lower left corner of the root window. Successive icons are placed in a row proceeding toward the right. Icons are prevented from overlapping. An icon will be placed in the position it last occupied if no icon is already there. If that place is taken, the icon will be placed at the next free location. The following three resources enable you to control the placement of icons: Table 7-9 Controlling Icon Placement with Window Manager Resources
The following table lists the icon placement schemes available to you: Table 7-10 Schemes for Automatic Placement of Icons
For example, if you want automatic placement of icons starting at the top of the screen and proceeding down the right side, you would have the following lines in your personal resource specifications:
mwm offers you a number of resources to control the specific appearance and behavior of icons. Using the iconDecoration resource, you can select exactly what parts of an icon you want to display: Table 7-11 The Values That Control the Appearance of Icons
Each icon image has a maximum and minimum size. mwm has both default sizes as well as maximum and minimum allowable sizes. Table 7-12 The Maximum and Minimum Sizes for Icon Images
How the window manager treats an icon depends on the size of the image in relation to the maximum and minimum sizes. Table 7-13 Image Size Affects Icon Treatment
You can use the following two resources to control icon image size: Table 7-14 Controlling Icon Image Size
Bear in mind that the overall width of an icon is the image width plus border padding and the image height is the icon height plus border padding. When you iconify a client, either the client supplies its own icon image, the window manager supplies a default image, or you supply an image of your own. There are two resources that tell the window manager where custom icons are located:
A number of resources enable you to specify the colors of icon elements. Table 7-15 Coloring and Tiling Icon Resources
Default values for these resources are the icon's bottom and top shadow pixmaps specified using the bottomShadowPixmap and topShandowPixmap resources set by the entries Mwm*icon*resource or Mwm*resource. The icon box allows you to use an icon box to contain icons, rather than having stand-alone icons on the workspace. The icon box is a scrollable window that displays icons in a grid (rows and columns). Icons in the icon box do not overlap. If there are icons that cannot be displayed in the visible part of the icon box, you can scroll to see the icons. The sliders within the scroll bars show the extent of the icon grid that is visible. The icon box can be minimized (iconified) just like any other window. If the icon box is minimized, it is placed into the icon grid on the workspace. Several resources specify whether an icon box is used, define its geometry and location, and specify its name (for looking up resources) and title.
For example, the following line specifies that icons will be placed in an icon box:
The icon box is displayed in a standard window management client frame. Client-specific resources for the icon box can be specified using "iconbox" as the client name. Mwm*iconbox*resource: value Resources that can be used with the icon box to change its appearance are:
The window menu for the icon box differs from the standard window menu in that it does not contain the "Close" selection. In its place is the "PackIcons" selection, which shifts icons to fill empty spaces in the icon placement grid so that the icons appear in neat, complete rows. Every client window that can be iconified has an icon in the icon box, even when the window is in the normal state. The icon for a client is put into the icon box when the client becomes managed by the window manager, and is removed from the icon box when the client stops. Icons for windows in the normal (open) state are visually distinct from icons for windows that are iconified. Icons for windows that are iconified look like stand-alone icons. Icons for windows that are in the normal state appear flat and are optionally grayed-out. The value of "True" for the fadeNormalIcon resource grays out icons for normalized windows. The default value is "False." The text and image attributes of icons in icon boxes are determined in the same way as for stand-alone icons, using the iconDecoration resource. A standard "control" location cursor is used to indicate the particular icon in the icon box to which keyboard actions apply. The location cursor is an unfilled rectangle that surrounds the icon. Icons contained in the icon box can be manipulated with the mouse and from the keyboard. Mouse button actions apply whenever the pointer is on any part of the icon. Table 7-16 Controlling Icons in the Icon Box With a Mouse
To manipulate an icon from the keyboard, make the icon box the active window and use the arrow keys to traverse the icons in the icon box. Pressing Return does the default action for the selected icon: for an icon of a normalized window, the window is raised; for an icon of an iconified window, the window is normalized. The arrow keys move the focus around the icons that are visible. The Tab key moves the keyboard input focus around the box in this order: icons, horizontal scroll bar, vertical scroll bar, icons. Shift Tab moves the focus in the opposite direction. |