⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch24.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 5 页
字号:


"out" state. If you click on the pin (in click-move-click mode) or move



over it and release (in press-drag- release mode), you will pin the menu to the workspace.



The menu will remain on the screen indefinitely, and you can execute commands from



it by clicking on its items. To remove the menu, move over the pin and click SELECT



on it.



<CENTER>



<H4><A NAME="Heading23<FONT COLOR="#000077">The Workspace Menu</FONT></H4>



</CENTER>



<P>Pressing MENU over the workspace brings up the Workspace menu. This menu is customizable,



but it typically contains at least the following items. The arrows to the right of



any item indicate a submenu for the displayed item. (See Figure 24.3.)



<H6></H6>



<P><A NAME="Heading24<A HREF="../art/24/24lnx03.jpg"><FONT COLOR="#000077">FIGURE



24.3.</FONT></A><FONT COLOR="#000077"> </FONT><I>The pinnable Workspace menu. </I><BR>



<BR>



Each option on the Workspace menu is discussed in the following list:







<UL>



	<LI>n Shells This item opens up another submenu with shells to choose from, including



	color terminals, X Terminals, VT100 emulator, and other assorted shells. (See Fig-



	ure 24.4.) You can also pin this menu to your desktop. Clicking the MENU button on



	the menu brings up another submenu enabling you to resize this menu.



</UL>







<H6></H6>



<P><A NAME="Heading25<A HREF="../art/24/24lnx04.jpg"><FONT COLOR="#000077">FIGURE



24.4.</FONT></A><FONT COLOR="#000077"> </FONT><I>The shell selections from the main



menu.</I>







<UL>



	<LI>Editors This item lets you select many types of editors, including <TT>Textedit</TT>,



	the standard OpenWindows text editor. See Figure 24.5 for a view of the <TT>Textedit</TT>.



</UL>







<H6></H6>



<P><A NAME="Heading26<A HREF="../art/24/24lnx05.jpg"><FONT COLOR="#000077">FIGURE



24.5.</FONT></A><FONT COLOR="#000077"> </FONT><I>The <TT>Textedit</TT> utility.</I>







<UL>



	<P>The Cut utility can be used to cut and paste sections between files. You can access



	any of the menu items by using the SELECT button on any of the menu items.



	<LI>Tools This opens up the File Manager, manual reader, calculator, spreadsheet,



	and other assorted items. (See Figure 24.6.)



</UL>







<H6><A HREF="../art/24/24lnx06.jpg</H6>



<P><A NAME="Heading27<A HREF="../art/24/24lnx06.jpg"><FONT COLOR="#000077">FIGURE



24.6. </FONT></A><I>The File Manager utility.</I>







<UL>



	<LI>Games This item has a submenu that enables you to invoke games. Check it out.



	<P>



	<LI>Utilities This item has a submenu that contains several utility functions for



	the workspace, including Refresh (redisplay all windows on the screen), Lock Screen,



	and Save Workspace.



	<P>



	<LI>Properties This item brings up the Workspace Properties window, which enables



	you to view and customize settings of the OpenWindows environment.



	<P>



	<LI>X11 Programs This items brings up a very long menu of all the X11 programs in



	<TT>/usr/bin/X11</TT>.



	<P>



	<LI>XView Programs This item brings up a very long menu of all the X11 programs in



	<TT>/usr/bin/openwin</TT>.



	<P>



	<LI>XV 3.00 This brings up the program that I used to capture all the screens for



	this book.



	<P>



	<LI>Window Menu This lets you choose any window on your desktop as your active window.



	<P>



	<LI>Screensaver This item lets you select a screen saver for your session. The Lock



	screen item is similar to screen saver except that it requires your password to restore



	the desktop.



	<P>



	<LI>Exit This selection shuts down all applications and exits the windowing system.



	A confirmation notice appears first to give you a chance to cancel the operation.



</UL>











<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading28<FONT COLOR="#000077"><B>NOTE: </B></FONT>In the menu for



	a window, you will see two selections: Close and Quit. The Close selection closes



	the window into an icon, but the application for that window is not terminated. The



	Quit selection actually terminates the program and gets rid of the window. 



<HR>







</DL>







<CENTER>



<H3><A NAME="Heading29<FONT COLOR="#000077">Configuring Menus for OpenWindows</FONT></H3>



</CENTER>



<P>Look in <TT>$OPENWINHOME/lib</TT> (normally <TT>/usr/openwin/lib</TT>) for the



file <TT>openwin-menu</TT> and other files of the form <TT>openwin-menu-*</TT>. Copy



these files into your home directory with a period in front of them. For example,



copy <TT>openwin-menu</TT> as <TT>.openwin-menu</TT>.</P>



<P>The <TT>.openwin-menu</TT> file is used to set up your workspace menu. Look at



Listing 24.2 for this file.



<CENTER>



<H3><A NAME="Heading30<FONT COLOR="#000077">Listing 24.2. The default .openwin-menu



file.</FONT></H3>



</CENTER>



<PRE><FONT COLOR="#0066FF">#



# @(#)openwin-menu      23.15 91/09/14 openwin-menu



#



#     OpenWindows default root menu file - top level menu



#







&quot;Workspace&quot; TITLE







&quot;Shells &quot; MENU          $OPENWINHOME/lib/openwin-menu-s







&quot;Editors &quot; MENU         $OPENWINHOME/lib/openwin-menu-e







&quot;Tools &quot; MENU           $OPENWINHOME/lib/openwin-menu-t







&quot;Games &quot; MENU           $OPENWINHOME/lib/openwin-menu-g







&quot;Utilities &quot; MENU       $OPENWINHOME/lib/openwin-menu-u







#&quot;Slingshot Examples &quot; MENU   $OPENWINHOME/lib/openwin-ss-ex



#



#&quot;UIT Examples &quot; MENU   $OPENWINHOME/lib/openwin-uit







&quot;Properties &quot;           PROPERTIES







SEPARATOR



&quot;X11 Programs &quot;         DIRMENU     /usr/X386/bin







&quot;XView Programs &quot; DIRMENU     $OPENWINHOME/bin



&quot;XV 3.00&quot;         exec /usr/X386/bin/xv







&quot;Window Menu &quot;    WINMENU







SEPARATOR







&quot;Screensaver &quot; MENU     $OPENWINHOME/lib/openwin-menu-screensave







&quot;Lock Screen &quot; MENU     $OPENWINHOME/lib/openwin-menu-xlock



&quot;Exit&quot;            EXIT



</FONT></PRE>



<P>Let's look at some of the entries in this <TT>.openwin-menu</TT> file.







<UL>



	<LI>The <TT>#</TT> signs mark lines as comments.



	<P>



	<LI>The line <TT>&quot;Workspace&quot; TITLE</TT> defines the name of the menu.



	<P>



	<LI>The next line defines <TT>&quot;Shells &quot;</TT> as a menu located in a file



	<TT>$OPENWINHOME/lib /openwin-menu-s</TT>.



	<P>



	<LI>The <TT>&quot;XV 3.00&quot;</TT> entry executes the command <TT>/usr/X386/bin/xv</TT>



	via the <TT>exec</TT> command.



	<P>



	<LI>The <TT>&quot;Window Menu &quot;</TT> entry invokes a special entry for selecting



	windows via a <TT>WINMENU</TT> type of window.



	<P>



	<LI>The <TT>&quot;XView Programs &quot;</TT> entry uses a type <TT>DIRMENU</TT> to



	list all the files in <TT>$OPENWINHOME/bin</TT>.



	<P>



	<LI>The <TT>SEPARATOR</TT> type draws an empty box at its position.



</UL>







<P>You can now use different files for customizing your menus differently by adding



or deleting items to this file.</P>



<P>The menu specification language has a number of keywords, all of which are in



all-uppercase letters.</P>



<P>The syntax for this file is straightforward. Each line typically specifies one



menu button. There are three fields per each uncommented line. The first field defines



a label, an optional keyword, and an action to take if the item is selected.</P>



<P>The label is either a single word or a string enclosed in double quotes. This



string appears in the menu button. If the optional keyword <TT>DEFAULT</TT> appears



next, this menu item becomes the default item for this menu. The rest of the line



(excluding leading whitespace) is considered to be a command. It is executed by sending



it to <TT>bash</TT>. Any shell metacharacters are passed through to the shell unchanged.</P>



<P>The command field can be extended onto the next line by placing a backslash (<TT>\</TT>)



at the end of the line. The newline will not be embedded in the command.</P>



<P>A submenu is specified using the special keyword <TT>MENU</TT> in place of a command.



A button is added to the current menu, and clicking or pulling right on this button



brings up the submenu. Subsequent lines in the menu file define buttons for the submenu,



until a line that has the special keyword <TT>END</TT> in the command field is encountered.



The label of the <TT>MENU</TT> line must match the label on the <TT>END</TT> line;



otherwise an error is signaled.</P>



<P>Submenus can be nested arbitrarily, bracketed by <TT>MENU</TT> and <TT>END</TT>



lines with matching labels.</P>



<P>Submenus can be defined in a different file using either the <TT>MENU</TT> or



the <TT>INCLUDE</TT> keyword. To include a submenu from another file, use a line



with a label, either the <TT>MENU</TT> or the <TT>INCLUDE</TT> keyword, and then



the filename. The file so named is assumed to contain lines that specify menu buttons.



The submenu file need not have any <TT>MENU</TT> or <TT>END</TT> lines (unless it



has submenus itself). The current file need not have a matching <TT>END</TT> line



if the submenu is read from another file. Submenu files included with the <TT>MENU</TT>



keyword are considered to be an integral part of the menu tree, and any error encountered



during the reading of the file will cause the entire menu to be considered invalid.



A submenu file included with the <TT>INCLUDE</TT> keyword is considered optional,



and any error encountered during reading of the file is not considered fatal. If



an error occurs during <TT>INCLUDE</TT> processing, a disabled (grayed-out) item



is inserted in place of the submenu and processing of the current menu file continues.</P>



<P>To make a submenu pinnable, add the special keyword <TT>PIN</TT> after the <TT>END</TT>



keyword on the line that ends the submenu definition, or after the <TT>TITLE</TT>



directive (I'll discuss that in a minute).</P>



<P>By default, the label in a menu button is used as the title of the submenu.</P>



<P>You can override this default by specifying a line that has the special keyword



<TT>TITLE</TT> in the command field. The label from this line is used as the submenu's



title. This line can appear anywhere in the submenu definition.</P>



<P>This action does not add an item to the menu. In addition, if the <TT>PIN</TT>



keyword follows the <TT>TITLE</TT> keyword on this line, the submenu is made pinnable.</P>



<P>This construct is useful for declaring a submenu defined in a separate file as



pinnable.</P>



<P>A line containing only the keyword <TT>SEPARATOR</TT> adds extra space before



the next item.</P>



<P>Table 24.1 lists keywords that can be used in the command field of a menu item.



They specify functions that are internal to <TT>olwm</TT> and that are not invoked



by running a shell. </P>



<CENTER>



<P><FONT SIZE="4"><B>Table 24.1. Special keywords in olwm. </B></FONT>



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><I>Keyword</I></TD>



		<TD ALIGN="LEFT"><I>Description</I></TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>BACK_SELN</TT></TD>



		<TD ALIGN="LEFT">Moves the selected windows and icons behind other windows.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>EXIT</TT></TD>



		<TD ALIGN="LEFT">Kills all applications and exits the window manager after getting confirmation from



			the user. (This is useful for exiting the entire window system.)</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>EXIT_NO_CONFIRM</TT></TD>



		<TD ALIGN="LEFT">Like <TT>EXIT</TT> but skips the confirmation notice.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>FLIPDRAG</TT></TD>



		<TD ALIGN="LEFT">Toggles the state of the <TT>DragWindow</TT> resource.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>FLIPFOCUS</TT></TD>



		<TD ALIGN="LEFT">Toggles the state of the <TT>SetInput</TT> resource.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>FULL_RESTORE_SIZE_SELN</TT></TD>



		<TD ALIGN="LEFT">Toggles the full-sized/normal-sized states of the selected windows and icons.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>NOP</TT></TD>



		<TD ALIGN="LEFT">No operation. Don't do anything.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>OPEN_CLOSE_SELN</TT></TD>



		<TD ALIGN="LEFT">Toggles the opened/closed states of the selected windows and icons.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>QUIT_SELN</TT></TD>



		<TD ALIGN="LEFT">Quits the selected windows and icons.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>PROPERTIES</TT></TD>



		<TD ALIGN="LEFT">Brings up Workspace Properties.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>REFRESH</TT></TD>



		<TD ALIGN="LEFT">Causes all windows on the screen to be repainted.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>REREAD_MENU_FILE</TT></TD>



		<TD ALIGN="LEFT">Forces an immediate rereading of the workspace menu customization file. <TT>olwm</TT>



			starts a complete search for a menu file and uses the first valid file it finds.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>RESTART</TT></TD>



		<TD ALIGN="LEFT">Restarts the window manager.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD ALIGN="LEFT"><TT>SAVE_WORKSPACE</TT></TD>



		<TD ALIGN="LEFT">Takes a snapshot of the set of currently running applications, and put the command



			lines so obtained into a file <TT>$HOME/.openwin init</TT> (in the user's home directory).</TD>



	</TR>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -