0091-0093.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 345 行

HTML
345
字号




<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:Common Desktop Environment</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311739 //-->

<!-- TITLE=RED HAT LINUX 2ND EDITION //-->

<!-- AUTHOR=DAVID PITTS ET AL //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS PUBLISHING //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=06 //-->

<!-- PAGES=0075-0096 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0087-0090.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0094-0096.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-91"><P>Page 91</P></A>











<!-- CODE //-->

<PRE>

CONTROL Dtmanpageview

{

   TYPE file

   CONTAINER_TYPE       SUBPANEL

   CONTAINER_NAME       HelpSubpanel

   POSITION_HINTS       last

   ICON Dthover

   FILE_NAME    /usr/dt/appconfig/appmanager/C/Desktop_Apps/Dtmanpageview

   HELP_STRING  The Man Page Viewer (Dtmanpageview) action displays a

&Acirc; man page in a Quick Help viewer window.

}

</PRE>

<!-- END CODE //-->











<P>This is what the Install Icon tools insert into a file when the Man Page viewer icon is

dragged into it. The two important directives are

CONTAINER_TYPE and CONTAINER_NAME, which specify the container type, a

SUBPANEL, and its name.

</P>









<P>The Install Icon control is probably the best mechanism to use when possible because it

avoids errors and installs nice extras, such as the help information shown in the preceding

example.

</P>









<H5><A NAME="ch06_ 19">

Subpanel Behavior

</A></H5>









<P>When you click controls on subpanels, their default behavior is to close. You can override

this but to do so, you must modify the default

PANEL definition.

</P>









<P>Create a file named main.fp file in

$HOME/.dt/types. To main.fp, copy the default

PANEL definition found in

/usr/dt/appconfig/types/C/dtwm.fp. (It starts at approximately line 18.)

</P>





<!-- CODE //-->

<PRE>

PANEL FrontPanel

{

  DISPLAY_HANDLES        True

  DISPLAY_MENU           True

  DISPLAY_MINIMIZE       True

  CONTROL_BEHAVIOR       single_click

  DISPLAY_CONTROL_LABELS False

  HELP_TOPIC             FPOnItemFrontPanel

  HELP_VOLUME            FPanel

}

</PRE>

<!-- END CODE //-->











<P>Add the following directive:

</P>





<!-- CODE SNIP //-->

<PRE>

SUBPANEL_UNPOST          False

</PRE>

<!-- END CODE SNIP //-->











<P>This is a good example of how to take advantage of the

way the Front Panel is dynamically constructed every time the CDE is initialized. A site administrator can add this

modification, also, to the

/etc/dt/appconfig/types/C area.

</P>









<H4><A NAME="ch06_ 20">

Restoring a Session When Something Goes Wrong

</A></H4>









<P>The Workspace Manager always saves a backup of the last session when it saves a new one.

If something goes wrong, this backup session can be activated in order to restore a login to

working order.

</P>



<A NAME="PAGENUM-92"><P>Page 92</P></A>















<P>Log in as the user with either the Fail-safe or CommandLine Login, or by switching to one

of the virtual terminals.

</P>









<P>Change to the $HOME/.dt/sessions directory. The old session is in the

current.old directory. Copy it to the current directory&#151;for

example,

</P>





<!-- CODE SNIP //-->

<PRE>

cd current.old; find . | cpio -pdmv ../current

</PRE>

<!-- END CODE SNIP //-->











<H4><A NAME="ch06_ 21">

Executing Applications and Commands at Login

</A></H4>









<P>When users log in to the desktop for the first time, the script

sys.session in /usr/dt/config/language/ is executed. It starts up a few desktop applications, including the Help Viewer.

</P>









<P>Like most files that accompany the default CDE package, this copy of

sys.session shouldn't be modified. Instead, users should place a new copy in

/etc/dt/config/language/ and modify it there. After a user logs out for the first time, he or she will have either a home or last

session for the desktop to restore, so this script will not run again.

</P>









<P>You might want to execute commands when you log in that cannot be set up via the

CDE, such as daemon processes, or perhaps an application 	such as

xv or xsetroot in order to place an alternative root window background. To do so, place a script named

sessionetc in the directory named

$HOME/.dt/sessions.

</P>









<P>For example, the following script would place the file

companylogo.jpg as the background at login:

</P>





<!--  CODE SNIP //--><PRE>#!/bin/sh

xv -root -rmode 5 -maxpect -quit $HOME/images/companylogo.jpg

</PRE>

<!-- END CODE SNIP //-->





<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

NOTE

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

Backgrounds set by xv are only visible when

NoBackdrop is selected in the CDE Style Manager.

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

</P>

<P>sessionetc is executed as a shell script. Therefore, either

xv must be in the user's search path, or the path must be fully qualified. In addition, the user must ensure that the path to the

image is correct and that the script has the executable bit for owner set. Also, any programs run

by sessionetc should either execute and exit in a timely manner or become

background because the script is run in serial with the rest of the login process. Any programs remaining in

the foreground for a long time will result in a delayed login.

</P>



<A NAME="PAGENUM-93"><P>Page 93</P></A>







<H4><A NAME="ch06_ 22">

Executing Commands at Logout

</A></H4>





<P>A similar script, sessionexit, can be placed in the same directory with commands to be

executed on logout, such as cleaning up a temporary directory or backing up some files.

Like sessionetc, the proper path must be available for any programs

that are run, and the programs that are run should either exit quickly or be placed in the background.

</P>





<H3><A NAME="ch06_ 23">

The Help Viewer

</A></H3>





<P>The CDE help facility is a welcome sight to the new UNIX user. It provides fully

indexed hyperlinks to topics about all the desktop applications and the desktop itself. It also

provides context-sensitive help from all the applications.

</P>





<H4><A NAME="ch06_ 24">

Using the Help Viewer

</A></H4>





<P>The Help Viewer is effectively a replacement for &quot;treeware&quot; (paper) documentation. Help

is divided into volumes, such as one for the File Manager, one for the Front Panel, and

another for the Help Viewer itself. This, combined with the viewer's powerful search system,

provides users with the ability to rapidly access exactly the information they need.

</P>





<P>The top portion of the window always displays a table of contents for the volume currently

in use (see Figure 6.6). The bottom portion displays the help document for the current topic.

On the right are navigation buttons for bringing up an index or a history window, for

backtracking to previously visited topics, and for jumping directly to the top-level topic in the

currently selected volume.

</P>





<P>The index is one of the more powerful features included in the Help Viewer. Help volumes

are selected in a simple dialog box and can be displayed as tiered indexes or searched. From

the index window, the desired help topic can be displayed.

</P>





<P>The history window provides rapid access to the help topics visited in the current help

session. It also organizes topics into volumes.

</P>





<H4><A NAME="ch06_ 25">

Context-Sensitive Help

</A></H4>





<P>All CDE controls have a Help option. Place the mouse over the Style Manager control,

right-click with the mouse, and select the Help option.

</P>





<P>The Help Viewer not only springs to life, but it displays a topic relevant to the control that

has focus. This will also happen inside any CDE application. Try it from the Text Editor or

Application Manager.

</P>





<P>The control labeled On Item Help produces similar behavior as the F1 key if the control

has focus. (When a control has focus, it is framed with a box.)

</P>





<P><CENTER>

<a href="0087-0090.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0094-0096.html">Next</A>

</CENTER></P>









</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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