?? rhl23.htm
字號:
*) if [ "$whoseargs" = "client" ]; then
clientargs="$clientargs $1"
else
serverargs="$serverargs $1"
fi ;;
esac
shift
done
xinit $clientargs — $serverargs</FONT></PRE>
<P>By the way, you can run any ol' manager you have, fvwm, twnm, olwm, and so on. I am simply using mwm as an example. Also note that you are running the mwm in the background. If you do not do this, you can't issue any commands to the xterm. See Figure
23.1 for what your display might now look like. Keep in mind that your display may look quite different from the picture in Figure 23.1 because your startup code has different applications.
<BR>
<P><B> <A HREF="23rhl01.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/23rhl01.gif">Figure 23.1. A typical Motif session.</A></B>
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>If you are in the bash, KORN, C, or any other common shell at this point, and you forgot the &, type Ctrl-Z to put the job in the background. If you are not running the Korn or C shells, you can kill mwm with Ctrl-C, and then restart it with the
ampersand.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>Congratulations! You are now running Motif.
<BR>
<P>Note that a lot of things can go wrong while getting to this point. Here are a few of the most common problems:
<BR>
<UL>
<LI>You cannot find the correct files. Ensure that the path includes /usr/X11/bin or the like.
<BR>
<BR>
<LI>You moved the cursor into the window, but now you have to click to be able to type commands to your xterm. By itself, X Window gives the focus to a window when a cursor is moved on to it. mwm, on the other hand, requires that you actually click the
left mouse button (Button1) for that window to get focus. Focus means that all user input (keyboard and pointer) is now be sent to that window. mwm changes the color of the window border to show that it has received focus.
<BR>
<BR>
<LI>There is not enough memory to run the system. This is especially true if you are on a PC-based platform. Typically, you can get away with 4MB of dynamic RAM for a simple X Window system, but you almost certainly need 8MB or more to be able to get a
reasonable response time on a PC. The memory upgrade to 8MB is well worth it, given the performance on a 4MB machine. Only the patient can live with 4MB.
<BR>
<BR>
<LI>The configuration does not look right. You have to modify the default startup parameters. See the "Customizing Motif" section.
<BR>
<BR>
<LI>Exiting the last command in your .xinitrc file terminates your entire X session. If your last command was an xterm and you logged off that xterm, your entire session is terminated. Generally, the last command in your .xinitrc file would be the window
manager so that terminating the window manager will also terminate your session.
<BR>
<BR>
</UL>
<BR>
<A NAME="E68E170"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Working with Motif Windows in </B><B>mwm</B></FONT></CENTER></H3>
<BR>
<P>Look at the typical xterm window in Motif, shown in Figure 23.2.
<BR>
<P><B> <A HREF="23rhl02.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/23rhl02.gif">Figure 23.2. A typical </B><B>xterm</B><B> window.</A></B>
<BR>
<P>The Title bar is the wide horizontal band on the top of the window. This contains the title for the application itself. In this case, this is the application itself, xterm. You can modify it to your needs. Try the following:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">xterm -name "I am here" &</FONT></PRE>
<P>The minimize button is used to iconify this xterm. The maximize button can be used to resize the window to occupy the entire display area. All corners can be used to resize the window by using the mouse. Note the pseudo—three-dimensional appearance
of the borders.
<BR>
<BR>
<A NAME="E69E282"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using the Pointer</B></FONT></CENTER></H4>
<BR>
<P>You will now work with some of the Motif windows that you have on the screen. Typically, you work with a mouse for the pointer, so the text refers to mice at times. However, you can always substitute your device name for the word mouse or pointer, and
not lose any meaning of the discussion.
<BR>
<P>Pointers in the mwm environment typically use three buttons, called Button1, Button2, and Button3. As an affront to left-handed individuals, Button1 is usually referred to as the left button because it is the most used button of the three. The left
button on a mouse is the one that is pressed with your right index finger. When you take the pointer to an item and press a button, you are clicking the button.
<BR>
<P>If you are left-handed, you can map your mouse or pointer buttons differently. See the section entitled, "Help for Left-Handed Users," later in this chapter.
<BR>
<BR>
<A NAME="E69E283"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Icons and Windows</B></FONT></CENTER></H4>
<BR>
<P>The minimize button enables you to iconify an application. An icon is a small symbol that represents an inactive window. The contents of that window are not visible, although they may be updated internally by its process. Icons can be moved around on a
screen, but they cannot be resized. Inactive windows that become active may hide icons. Icons save valuable screen space when you're using applications that do not require your constant attention.
<BR>
<BR>
<A NAME="E69E284"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Iconifying a Window</B></FONT></CENTER></H4>
<BR>
<P>Move the cursor to the minimize button, and press the left button on the mouse. The window is removed from the screen, and a smaller icon is seen somewhere on the left of the screen. The minimize button is the one with the smaller square near the right
side of the frame. The maximize button is the one with the bigger square and can be found on the right side of the frame.
<BR>
<P>To restore an icon to a screen, move the cursor to the icon and click on Button1 twice in quick succession. This is known as double-clicking the mouse. Some Motif icons are shown in the bottom left side of Figure 23.3.
<BR>
<P><B> <A HREF="tppmsgs/msgs1.htm#134" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/23rhl03.gif">Figure 23.3. Typical Motif icons.</A></B>
<BR>
<BR>
<A NAME="E69E285"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Maximizing a Window</B></FONT></CENTER></H4>
<BR>
<P>Move the cursor to the maximize button, and press Button1. This enlarges the window to the size of the root window. This way, you can have a huge clock on your screen. Some applications, such as older versions of calc, do not adjust their internal
graphic areas when their frame is resized. This leads to annoying blank space on a screen.
<BR>
<P>Use the maximize button as a toggle. Clicking on an already maximized window causes it to revert to its size and position (also known as geometry) before it was maximized. Clicking on it again remaximizes it.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Avoid resizing a window when running a vi session under an xterm. This leads to unpredictable results and may cause vi to behave very strangely.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E69E286"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Sizing a Window</B></FONT></CENTER></H4>
<BR>
<P>The entire frame on a Motif window is a control that enables you to resize the window. See Figure 23.2 for the size controls. The four corners enable you to stretch the window by each corner. The four long bars let you move the edges of the window with
the mouse.
<BR>
<P>To stretch the window using a corner, move the mouse to that corner. Press Button1 and, while keeping it pressed, move the mouse. You should see the cursor change its shape to a double-headed arrow, and a thin border will appear, indicating the size and
orientation of the current stretch operation. Size the window by moving the mouse with Button1 pressed. Release the button when you have achieved the desired size.
<BR>
<P>Note that some applications do not have these sizing controls enabled. An example is the cute, but not very useful, pointer tracking program called xeyes, or the clock program called oclock. (See Figure 23.4.)
<BR>
<P><B> <A HREF="tppmsgs/msgs1.htm#135" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/23rhl04.gif">Figure 23.4. The </B><B>oclock</B><B> program has a window without </B><B>resize borders.</A></B>
<BR>
<P>To move the edges of the window, move the mouse to that edge. You should see your cursor change shape to a vertical double-headed arrow if you are on a horizontal edge (top or bottom of window). As you move the pointer, a thin border will appear
indicating the size and orientation of the current stretch operation. If you are on a vertical edge, the double-headed arrow is horizontal. Press Button1 and, while keeping it pressed, move the pointer around. This moves the edge along with your pointer.
Release the button when you have the edge where you want it.
<BR>
<P>While you are resizing this window, you see a small box come up in the center of the display. This box contains the size of the window in pixels if it's a graphics image, or in rows and columns (in number of characters) if it's an xterm. On some
systems, you can use the arrow keys on your keyboard to achieve precision when resizing your windows. Remember to keep the button pressed while you use the arrow keys on your keyboard to do the precise adjustment.
<BR>
<BR>
<A NAME="E69E287"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Focus and Selecting a Window</B></FONT></CENTER></H4>
<BR>
<P>You can select a window or icon to get focus by moving the pointer to that item and pressing the left button. This moves the window or icon to the top of the stack. This way, the window or icon isn't obscured by any other screen item.
<BR>
<P>When a window has focus, it collects all the user input from the pointer and the keyboard. There are two types of focus for a window: click to type and explicit. The click to type focus requires a user to click a pointer button in a window for it to get
focus. The explicit focus requires only that the cursor be in the window for the window to get focus. Explicit focus is sometimes referred to as real estate driven focus.
<BR>
<P>In some cases, you want to have the focus where the mouse is, without having to click the pointer button. Sometimes this is not useful for touch typists, because a single movement of the pointer can have the keystroke sent to the wrong window.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Sometimes it's a good idea to click on the frame to get focus to a window because clicking in the window might accidentally press a button or other control in the window.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>After you give the focus to a client, it collects all typed or graphics information until the user clicks elsewhere.
<BR>
<P>Getting focus also raises the window to the top of the stack. The window frame color changes at this point. You can set the focus to an icon too by selecting it with a mouse. The name of the icon expands at that point, and you see the window menu for
that icon. You can move the mouse away from the menu, but the icon retains the focus until you click elsewhere.
<BR>
<P>The color change scheme depends on your site's default colors. In some cases, you may not see any color change at all if the focused and out-of-focus colors are the same.
<BR>
<BR>
<A NAME="E69E288"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Moving a Window or Icon</B></FONT></CENTER></H4>
<BR>
<P>In order to move a window's location on the screen, complete the following steps:
<BR>
<OL>
<LI>Move the cursor on top of the title bar.
<BR>
<BR>
<LI>Press and hold down pointer Button1.
<BR>
<BR>
<LI>Move the pointer to the desired location. You should see an outline of the window border move with your pointer.
<BR>
<BR>
<LI>Place the outline at the part of the screen where you want your window to be. This is referred to as dragging the window.
<BR>
<BR>
<LI>Release Button1. The window now appears at the new location. It is also the window with the focus by default.
<BR>
<BR>
</OL>
<P>This procedure can be duplicated for an icon. In the case of an icon, you click and drag with the cursor in the icon itself.
<BR>
<P>While you are moving the window, you see a small box in the center of the screen with two numbers in it. These are positive X and Y offsets of the top left corner of the window from the top left corner of the screen. This is very useful information when
trying to precisely place a window on the screen.
<BR>
<P>You can achieve some fine precision by pressing the arrow keys on the numeric keypad to move the window one step at a time. You must keep the pointer button pressed while you use the arrow keys.
<BR>
<BR>
<A NAME="E69E289"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Adding a New Window</B></FONT></CENTER></H4>
<BR>
<P>Say you want to add a calculator to your screen. Type in
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">$ xcalc &</FONT></PRE>
<P>at the prompt in an xterm window. The calculator should appear on the screen. To get another xterm, type the following command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">$ xterm &</FONT></PRE>
<P>Depending on your site, this can appear anywhere on the screen. Typically, the new window is placed in the upper left corner (x=0,y=0) of the root window, or in the center of the root window.
<BR>
<P>The size and location of a window is referred to as the window's geometry.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>The reason why you launch applications with an ampersand (&) at the end of the command is to run the application in the background and free up the xterm from which the application is being run. If you do not type the ampersand, the xterm will not
accept input until that application is either suspended or killed. Also, the use of the ampersand allows the application to run even after the xterm from which it was run is killed.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E69E290"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Window Geometry</B></FONT></CENTER></H4>
<BR>
<P>Almost all clients accept the -geometry command line option. This option tells the window manager where to locate the window on the screen. If you do not specify any geometry, the window manager uses its defaults.
<BR>
<P>The coordinate system for the root window is as follows:
<BR>
<UL>
<LI>The origin is top left (0,0).
<BR>
<BR>
<LI>The number of display units is in pixels for graphics.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -