September 1996
|
|
The TWM Window Manager twm(1) is one of the more widely available window managers for the X11 environment. It was the default on our systems for some years but is no longer recommended. This document describes the default TWM environment on Unix systems supported by Information Technology Services (ITS) at The University of Western Ontario. You may be using a vendor supplied configuration, your system manager may have configured a slightly different environment, or you may have customized your environment, nevertheless this discussion of the environment ITS supports should be a reasonable guide for most new users of TWM on any Unix system.
To use twm(1), you'll need to have an X11 station (or PC with an X11 server) configured for login (usually with xdm(1)) to some system (usually Unix) which supports the TWM window manager twm(1). This is a very common window manager and we have yet to see a Unix machine without it. Nevertheless, you ought to verify that it is available before trying to use it.
The TWM window manager is twm(1) and is usually found as /usr/bin/X11/twm. If you want to use it, and it's not the default on your system, create a .xsession file in your home directory and set your window manager:
WMANAGER=twmOn ITS supported Unix platforms, the .xsession file is used to customize your X11 environment. That includes the choice of window manager. Other choices are mwm, ncdlauncher, and olwm. You might make other configuration settings - to set alternate printers (assuming you have a PostScript printer called ``larry'' and a hammer printer called ``moe''):
POSTSCRIPT=larry PRINTER=moeIf you have twm(1), and have set the WMANAGER as above, then at next login you should get a session managed by the TWM Window Manager twm(1) rather than the default selected by your system manager. You can, with confidence, just play with it to learn what it does - you're not going to break anything and there should be no big surprises. Many users do that without reading any documentation. The remainder of this discussion documents how things work.
First some terminology about the X11 environment. Windows are rectangular portions of the display managed by client applications like xterm(1), xmh(1), xlock(1) and others. The window manager (be it twm(1) or any of the others) is an application for managing those windows. A virtue of X11 is that one can manage and display lots of applications.
The window manager puts some ``trim'' around most windows - a title bar (with some buttons to press) and a frame around the window. The interior of the window is managed by the application, the trim is managed by the window manager. The TWM trim is fairly simple with a title at the top containing an iconify button at the left and a resize button on the right (since this is configurable your system manager may be providing you with something entirely different). Around the edge is a border that also belongs to the window manager.
Windows can be ``iconified'' in which case a small icon (or picture) remains on the screen as a representation of the window which is no longer visible. Icons are usually placed on the screen starting in the upper left corner (as is the case for TWM as supported by ITS). Turning windows into icons helps to free up space and reduce clutter on your screen. Icons can, of course, be deiconified - ie. turned back into windows. With TWM, you turn icons back into windows by clicking on them with the leftmost button of your mouse.
The ``root'' window is the background window in which all other windows reside. You usually communicate with the window manager in the root window. Mouse button clicks in the root menu implement window manager functions. With TWM, button clicks in the root window bring up menus where you can select various functions.
You communicate with the applications and window manager using a keyboard and mouse. Keyboard and mouse events (usually button presses) may result in some action on the part of either the window manager or the application which controls the window. With TWM, button clicks on the window trim or in the root window implement window manager functions.
Your mouse should have three buttons named from left to right Button1, Button2, and Button3. TWM, as configured by ITS, will work well enough with a two button mouse but a three button mouse is recommended. You can, with some effort, chord two buttons to make the third on a two button mouse but it's hard to do.
Keyboard and mouse events can be modified by other keys to produce different actions - the usual modifiers are shift, control, alt and meta (but there are many more). Mouse Button modifiers include things like double clicks and chording (ie. the simultaneous pressing of several mouse buttons). TWM, as configured at ITS, has some modified button sequences but these are seldom used.
The window ``focus'' determines where keyboard and mouse events should be sent. The usual configuration at ITS is one where the keyboard focus follows the mouse location indicated by a pointer and that is the case for our TWM environment. TWM can be configured to use ``click to focus'' (ie. you move the pointer to where you want the focus and click a mouse button).
The window which has the focus will be highlighted and the mouse location determines whether the events are for the window or window manager. When on the trim, mouse and keyboard events are directed to the window manager. Within the window, events are usually directed to the application rather than the window manager. But there are some exceptions with TWM where you can do ``<modifer><Button>'' to effect a window manager operation (like move, resize, close, etc.) This can cause conflicts, eg. ``<control>Button1'' is a keyboard event for xterm(1) but you could configure the window manager to use that for something else.
Many applications, including the window manager, will display ``menus'' for choices. With TWM, menus are brought up in the root window by pressing and holding any of the mouse buttons. To select an item from a menu you hold the mouse button down and slide down to your selection. Note that applications selected from these menus usually start off as a wire frame which you position on your display (it will grab your mouse pointer) and drop into place with a button click.
As well, the rightmost mouse button brings up a menu of windowing functions when depressed anywhere on the title bar or surrounding border. These are operations that can be applied to that window.
In the root window the three mouse buttons bring up menus as follows:
Button1 is the most important and naturally falls under your index finger on the mouse (unless you are left handed). That's intentional as these are the applications one would usually use.
Note that menus may include submenus. For example, on the X Window Applications menu you'll find submenus for Other Apps..., Help..., and others including the menus assigned to Button2 and Button3 (hence you can get at these menus even if you don't have a three button mouse).
Selections are made from these menus by holding the mouse button down, sliding down to the item you want (selections are highlighted as you slide through the menu) and then releasing the button on the item you're after. Submenus will pop up to the right when selected and you can slide through menus into submenus. Keep your button held down and move your mouse into the pop up menus to select items. If you've brought up a menu but you don't want to select anything just release your mouse on the menu title bar or anywhere outside the menu.
An important menu selection on Button1 (your left mouse button) in the root window is the ``Gripe'' selection. If you have questions, gripes, or concerns, use this to enter a note for mailing to the team that supports the X11 environment at ITS. We are trying to provide a good environment for our users; your comments will help to make that a better environment.
We have some panic buttons in the root window for when life is difficult (these should get you out of trouble if you're building your own menus). They're supposed to be an odd enough key sequence that you're unlikely to hit them by mistake.
In general we've found these are seldom used, and usually the sequence has been forgotten when needed. Nevertheless, these remain as operations one can take advantage of.
As noted, the window trim is an area supported by the window manager. Mouse button events on the window trim are used to effect window management functions on that window - to move, resize, iconify, and so on. Pressing Button3 (the right mouse button) on the title bar or edge trim gives a menu of operations. Some of these are also implemented as simple mouse commands:
Some button accelerators (or short cuts) are provided that work anywhere within a window as well as on the window trim and title bar:
Although these accelerators are available they're seldom used. People usually use the simple button commands or pull down the window menu with Button3. Nevertheless, these remain as commands that can be used.
Icons are windows that have been minimized as a little window. The usual operation with an icon is to turn it back into the original window. The complete Button assignments for Icons are:
In most text windows you can cut out text, move to another window, and then paste the text back in. These are operations that apply equally to all window managers (it works for TWM and other window managers). Nevertheless, we document the operation here.
The cut operation, which selects text for pasting, is simple but has several variations. In each case the highlighted area shows the area that has been cut (or marked for pasting). Each variation has its virtues, you should try all three.
The paste operation is the simplest - move to where you want the text you have cut inserted and click Button2:
If there's no text in the cut buffer (ie. you haven't cut out any text) then the pasting operation doesn't do anything.
The TWM manual page twm(1) is long and tedious reading but includes more information and customization settings not discussed here. The Help.. submenu on the X Window Applications menu has lots of interesting reading.
These days most people choose Motif but there are a few using TWM (which we would not recommend) or OpenLook (often the choice on SunOS and Solaris). Sun has made a commitment to deliver Motif so it will soon be available on all our Unix platforms. The recommended window manager is therefore Motif (if available). On NCD displays there is a built in window manager that is a Motif look alike - it's often the choice for those with an NCD station. For more information on these window managers see:
Your comments and suggestions are important; we welcome them.
©1996, The University of Western Ontario. Permission is granted to copy in whole or in part provided that due credit is given to the authors, the Division of Information Technology Services, and The University of Western Ontario.