Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
19
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/BEntity.sgm
Normal file
19
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/BEntity.sgm
Normal file
@@ -0,0 +1,19 @@
|
||||
<!-- $XConsortium: BEntity.sgm /main/2 1996/12/17 05:35:13 cde-hit $ -->
|
||||
<!ENTITY DKSUG.scr1.fig.1 SYSTEM "./dtkshGuide/graphics/dttest1.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.1 SYSTEM "./dtkshGuide/graphics/findwin.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.2 SYSTEM "./dtkshGuide/graphics/finderr.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.3 SYSTEM "./dtkshGuide/graphics/findterm.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.4 SYSTEM "./dtkshGuide/graphics/labfindw.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.5 SYSTEM "./dtkshGuide/graphics/area1.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.6 SYSTEM "./dtkshGuide/graphics/area2.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.7 SYSTEM "./dtkshGuide/graphics/area3.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.8 SYSTEM "./dtkshGuide/graphics/area4.tif" NDATA TIFF>
|
||||
|
||||
3
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/Title.tmpl
Normal file
3
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/Title.tmpl
Normal file
@@ -0,0 +1,3 @@
|
||||
/* $XConsortium: Title.tmpl /main/2 1996/06/19 16:03:17 drk $ */
|
||||
/* TOC title, only what's between quotes should be modified. */
|
||||
title = "共通デスクトップ環境 デスクトップ KornShell ユーザーズ・ガイド"
|
||||
59
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/adbook.sgm
Normal file
59
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/adbook.sgm
Normal file
@@ -0,0 +1,59 @@
|
||||
<!-- $XConsortium: adbook.sgm /main/2 1996/12/17 05:35:27 cde-hit $ -->
|
||||
<!DOCTYPE DocBook PUBLIC "-//HaL and O'Reilly//DTD DocBook V2.2.1//EN" [
|
||||
|
||||
|
||||
<!ENTITY DKSUG.scr1.fig.1 SYSTEM "./graphics/dttest1.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.1 SYSTEM "./graphics/findwin.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.2 SYSTEM "./graphics/finderr.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.3 SYSTEM "./graphics/findterm.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.4 SYSTEM "./graphics/labfindw.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.5 SYSTEM "./graphics/area1.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.6 SYSTEM "./graphics/area2.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.7 SYSTEM "./graphics/area3.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY DKSUG.scr2.fig.8 SYSTEM "./graphics/area4.tif" NDATA TIFF>
|
||||
|
||||
<!ENTITY % local.notations "| XPM | XBM | XWD">
|
||||
<!NOTATION XPM SYSTEM "XPM">
|
||||
<!NOTATION XBM SYSTEM "XBM">
|
||||
<!NOTATION XWD SYSTEM "XWD">
|
||||
|
||||
|
||||
<!ENTITY Pref SYSTEM "./preface.sgm">
|
||||
<!ENTITY Intro SYSTEM "./ch01.sgm">
|
||||
<!ENTITY scr1 SYSTEM "./ch02.sgm">
|
||||
<!ENTITY adv SYSTEM "./ch03.sgm">
|
||||
<!ENTITY scr2 SYSTEM "./ch04.sgm">
|
||||
<!ENTITY cmds SYSTEM "./appa.sgm">
|
||||
<!ENTITY convf SYSTEM "./appb.sgm">
|
||||
<!ENTITY finds SYSTEM "./appc.sgm">
|
||||
|
||||
|
||||
|
||||
]>
|
||||
|
||||
<!-- ____________________________________________________________________________ -->
|
||||
|
||||
<DocBook>
|
||||
<Book>
|
||||
|
||||
<Title>共通デスクトップ環境 デスクトップ KornShell ユーザーズ・ガイド</Title>
|
||||
|
||||
&Pref;
|
||||
&Intro;
|
||||
&scr1;
|
||||
&adv;
|
||||
&scr2;
|
||||
&cmds;
|
||||
&convf;
|
||||
&finds;
|
||||
|
||||
</Book>
|
||||
</DocBook>
|
||||
1054
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/appa.sgm
Normal file
1054
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/appa.sgm
Normal file
File diff suppressed because it is too large
Load Diff
238
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/appb.sgm
Normal file
238
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/appb.sgm
Normal file
@@ -0,0 +1,238 @@
|
||||
<!-- $XConsortium: appb.sgm /main/6 1996/08/25 15:09:01 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<appendix id="DKSUG.convf.div.1">
|
||||
<title>dtksh簡易関数<indexterm><primary>簡易関数</primary></indexterm></title>
|
||||
<para><command>dtksh</command>ユーティリティは、簡易関数のファイルを含んでいます。この関数は、
|
||||
シェル・プログラマにとって有益なシェル関数を含むシェル・スクリプトです。シェル
|
||||
関数は、シェル・プログラマが頻繁に行わなければならない操作を実行します。これらには
|
||||
ある種類のダイアログ(ヘルプ、エラー、警告など)を手早く作成する関数、いくつかの
|
||||
ボタンを容易に作成する関数、フォーム・ウィジェットの子に対する制約リソースを容易
|
||||
に作成する関数が含まれています。
|
||||
シェル・スクリプトの作成者はこれらの簡易関数を必ず使用する必要はありません。
|
||||
開発者がより短期間で、よりわかりやすいシェル・スクリプトを、より簡単に作成できる
|
||||
ように提供されています。</para>
|
||||
<para>シェル・スクリプトがこれらの関数にアクセスする前に、簡易関数を含んでいるファイルを
|
||||
取り込まなければなりません。簡易関数は、<filename>/usr/dt/scripts/DtFuncs.sh.</filename>ファイルに
|
||||
あります。シェル・スクリプトにそれらを取り込みには、次のように記述します。</para>
|
||||
<programlisting>. /usr/dt/lib/dtksh/DtFuncs.dtsh</programlisting>
|
||||
<sect1 id="DKSUG.convf.div.2">
|
||||
<title>DtkshAddButtons<indexterm><primary>DtkshAddButtons</primary></indexterm></title>
|
||||
<para><command>DtkshAddButtons</command>はコンポジット・ウィジェット内に同じ種類のボタンを1つ以上
|
||||
追加します。いくつかのボタンを、メニュー区画またはメニューバーに追加するために、
|
||||
最も頻繁に使用されます。</para>
|
||||
<para>使用方法は次のとおりです。</para>
|
||||
<programlisting>DtkshAddButtons parent widgetClass label1 callback1
|
||||
[label2 callback2 ...]
|
||||
DtkshAddButtons [-w] parent widgetClass variable1 label1 callback1 \
|
||||
[variable2 label2 callback2 ...]</programlisting>
|
||||
<para><filename>-w</filename>オプションは、作成する各ボタンのウィジェット・ハンドルを簡易関数が返すように
|
||||
指示します。ウィジェット・ハンドルは、指定した環境変数に返されます。<command>widgetClass</command>
|
||||
パラメータは、次のいずれかに設定できます。何も指定しなかった場合のデフォルトは
|
||||
<command>XmPushButtonGadget</command>です。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><command>XmPushButton</command></para>
|
||||
</listitem><listitem><para><command>XmPushButtonGadget</command></para>
|
||||
</listitem><listitem><para><command>XmToggleButton</command></para>
|
||||
</listitem><listitem><para><command>XmToggleButtonGadget</command></para>
|
||||
</listitem><listitem><para><command>XmCascadeButton</command></para>
|
||||
</listitem><listitem><para><command>XmCascadeButtonGadget</command></para>
|
||||
</listitem></itemizedlist>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>DtkshAddButtons $MENU XmPushButtonGadget Open do_Open Save do_Save
|
||||
Quit exit
|
||||
DtkshAddButtons -w $MENU XmPushButtonGadget B1 Open do_Open B2 Save
|
||||
do_Save</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.3">
|
||||
<title>DtkshSetReturnKeyControls<indexterm><primary>DtkshSetReturnKeyControls</primary></indexterm></title>
|
||||
<para><command>DtkshSetReturnKeyControls</command>は、フォーム・ウィジェット内にテキスト・ウィジェットを
|
||||
作成し、リターン・キーがフォーム・ウィジェット内のデフォルト・ボタンを動作せず、
|
||||
フォーム・ウィジェット内の次のテキスト・ウィジェットにフォーカスが移動するように
|
||||
します。これは、一連のテキスト・ウィジェットを含むウィンドウがあり、最後の
|
||||
テキスト・ウィジェットにフォーカスがある間にユーザが改行キーを押すまで、デフォルト
|
||||
が動作しないようにする場合に便利です。</para>
|
||||
<para>使用方法は次のとおりです。</para>
|
||||
<programlisting>DtkshSetReturnKeyControls textWidget nextTextWidget formWidget
|
||||
defaultButton</programlisting>
|
||||
<para><symbol role="Variable">textWidget</symbol>パラメータは、改行キーが押されるとフォーカスが次の
|
||||
テキスト・ウィジェット(<symbol role="Variable">nextTextWidget</symbol>パラメータで指定したもの)に移動するように
|
||||
構成されたウィジェットを指定します。<symbol role="Variable">formWidget</symbol>パラメータは、デフォルト・ボタンを
|
||||
含み、2つのテキスト・ウィジェットの親になるフォーム・ウィジェットを指定します。
|
||||
<symbol role="Variable">defaultButton</symbol>パラメータは、フォーム・ウィジェット内でデフォルト・ボタンとして扱われるコンポーネントを指定します。</para>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>DtkshSetReturnKeyControls $TEXT1 $TEXT2 $FORM $OK
|
||||
DtkshSetReturnKeyControls $TEXT2 $TEXT3 $FORM $OK</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.4">
|
||||
<title>DtkshUnder、DtkshOver、DtkshRightOf、DtkshLeftOf<indexterm><primary>DtkshUnder</primary></indexterm><indexterm><primary>DtkshOver</primary></indexterm><indexterm>
|
||||
<primary>DtkshRightOf</primary></indexterm><indexterm><primary>DtkshLeftOf</primary></indexterm></title>
|
||||
<para>これらの簡易関数は、フォーム・ウィジェットの制約条件のクラスの指定を簡易化します。
|
||||
コンポーネントを他のコンポーネントの端1つに接続する方法を提供します。
|
||||
これは<filename>ATTACH_WIDET</filename>制約条件を使用して実行されます。</para>
|
||||
<para>使用方法は次のとおりです。</para>
|
||||
<programlisting>DtkshUnder widgetId [offset]
|
||||
DtkshOver widgetId [offset]
|
||||
DtkshRightOf widgetId [offset]
|
||||
DtkshLeftOf widgetId [offset]</programlisting>
|
||||
<para><symbol role="Variable">widgetId</symbol>パラメータは、現在のコンポーネントを接続するコンポーネントを指定します。
|
||||
<symbol role="Variable">offset</symbol>値はオプションで、指定されていない場合のデフォルト値は0です。</para>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>XtCreateManagedWidget BUTTON4 button4 XmPushButton $FORM \
|
||||
labelString:“Exit“ \
|
||||
$(DtkshUnder $BUTTON2) \
|
||||
$(DtkshRightOf $BUTTON3)</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.5">
|
||||
<title>DtkshFloatRight、DtkshFloatLeft、DtkshFloatTop、DtkshFloatBottom<indexterm>
|
||||
<primary>DtkshFloatRight</primary></indexterm><indexterm><primary>DtkshFloatLeft</primary></indexterm><indexterm><primary>DtkshFloatTop</primary></indexterm><indexterm>
|
||||
<primary>DtkshFloatBottom</primary></indexterm></title>
|
||||
<para>これらの簡易関数は、フォーム・ウィジェットの制約条件のクラスの指定を簡易化します。
|
||||
フォーム・ウィジェット内の他のコンポーネントに依存せずに、コンポーネントを配置
|
||||
する方法を提供します。フォーム・ウィジェットが伸縮しても、コンポーネントは
|
||||
フォーム・ウィジェット内の相対位置を維持します。コンポーネントに対して他の
|
||||
フォーム・ウィジェットの制約条件が指定されると、コンポーネントは伸縮します。
|
||||
これは<filename>ATTACH_POSITION</filename>制約条件を使用して実行されます。</para>
|
||||
<para>使用方法は次のとおりです。</para>
|
||||
<programlisting>DtkshFloatRight [position]
|
||||
DtkshFloatLeft [position]
|
||||
DtkshFloatTop [position]
|
||||
DtkshFloatBottom [position]</programlisting>
|
||||
<para>オプションの<symbol role="Variable">position</symbol>パラメータは、コンポーネントの指定した端を配置する
|
||||
相対位置を指定します。<symbol role="Variable">position</symbol>値はオプションで、
|
||||
指定されていない場合のデフォルトは0です。</para>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>XtCreateManagedWidget BUTTON1 button1 XmPushButton $FORM \
|
||||
labelString:“Ok“ \
|
||||
$(DtkshUnder $SEPARATOR) \
|
||||
$(DtkshFloatLeft 10) \
|
||||
$(DtkshFloatRight 40)</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.6">
|
||||
<title>DtkshAnchorRight、DtkshAnchorLeft、DtkshAnchorTop、DtkshAnchorBottom<indexterm>
|
||||
<primary>DtkshAnchorRight</primary></indexterm><indexterm><primary>DtkshAnchorLeft</primary></indexterm><indexterm><primary>DtkshAnchorTop</primary></indexterm><indexterm>
|
||||
<primary>DtkshAnchorBottom</primary></indexterm></title>
|
||||
<para>これらの簡易関数は、フォーム・ウィジェットの制約条件のクラスの指定を簡易化します。
|
||||
フォーム・ウィジェットを伸縮してもコンポーネントの位置が変更しないように、
|
||||
フォーム・ウィジェットの1つの端にコンポーネントを接続する方法を提供します。
|
||||
ただし、このコンポーネントに設定されている他のフォーム・ウィジェットの制約条件
|
||||
によっては、サイズの伸縮がまだ行われる場合があります。
|
||||
これは、<filename>ATTACH_FORM</filename>制約条件を使用して実行されます。</para>
|
||||
<para>使用方法を次に示します。</para>
|
||||
<programlisting>DtkshAnchorRight [offset]
|
||||
DtkshAnchorLeft [offset]
|
||||
DtkshAnchorTop [offset]
|
||||
DtkshAnchorBottom [offset]</programlisting>
|
||||
<para>オプションの<symbol role="Variable">offset</symbol>パラメータは、コンポーネントを配置するフォーム・ウィジェット
|
||||
の端からの距離を指定します。offsetが指定されていない場合は0を使用します。</para>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>XtCreateManagedWidget BUTTON1 button1 XmPushButton $FORM \
|
||||
labelString:“Ok“ \
|
||||
$(DtkshUnder $SEPARATOR) \
|
||||
$(DtkshAnchorLeft 10) \
|
||||
$(DtkshAnchorBottom 10)</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.7">
|
||||
<title>DtkshSpanWidthおよびDtkshSpanHeight<indexterm><primary>DtkshSpanWidth</primary></indexterm><indexterm><primary>DtkshSpanHeight</primary></indexterm></title>
|
||||
<para>これらの簡易関数は、フォーム・ウィジェットの制約条件のクラスの指定を簡易化します。
|
||||
フォーム・ウィジェットの高さまたは幅を最大に広げるように構成する方法を提供します。
|
||||
これは、フォーム・ウィジェットに、2つのコンポーネントの端(<command>DtSpanHeight</command>の上下、
|
||||
<command>DtSpanWidth</command>の左右)を接続することによって実行します。、
|
||||
通常、フォーム・ウィジェットがサイズ変更すると、コンポーネントも必ずサイズ変更します。
|
||||
<filename>ATTACH_FORM</filename>制約条件がすべてのアタッチメントで使用されます。</para>
|
||||
<para>使用方法は次のとおりです。</para>
|
||||
<programlisting>DtkshSpanWidth [leftOffset rightOffset]
|
||||
DtkshSpanHeight [topOffset bottomOffset]</programlisting>
|
||||
<para>オプションの<symbol role="Variable">offset</symbol>パラメータは、コンポーネントを配置するフォーム・ウィジェットの
|
||||
端からの距離を指定します。 offsetを指定しなかった場合のデフォルトは0です。</para>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>XtCreateManagedWidget SEP sep XmSeparator $FORM \
|
||||
$(DtkshSpanWidth 1 1)</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.8">
|
||||
<title>DtkshDisplayInformationDialog、DtkshDisplayQuestionDialog、DtDisplayWarningDialog、
|
||||
DtkshDisplayWorkingDialog、DtkshDisplayErrorDialog<indexterm><primary>DtkshDisplayInformationDialog</primary></indexterm><indexterm><primary>DtkshDisplayQuestionDialog</primary></indexterm><indexterm><primary>DtDisplayWarningDialog</primary>
|
||||
</indexterm><indexterm><primary>DtkshDisplayWorkingDialog</primary></indexterm><indexterm>
|
||||
<primary>DtkshDisplayErrorDialog</primary></indexterm></title>
|
||||
<para>これらの簡易関数は、Motifフィードバック・ダイアログのそれぞれの単一インスタンスを
|
||||
作成します。要求したダイアログ型のインスタンスが既に存在している場合は、それを
|
||||
再利用します。ダイアログの親は、環境変数<filename>$TOPLEVEL</filename>から取得
|
||||
します。これは、シェル・スクリプトの呼び出しよって設定され、その後、変更されません。
|
||||
要求されたダイアログのハンドルは、次の環境変数のいずれかに返されます。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>_DTKSH_ERROR_DIALOG_HANDLE</filename></para>
|
||||
</listitem><listitem><para><filename>_DTKSH_QUESTION_DIALOG_HANDLE</filename></para>
|
||||
</listitem><listitem><para><filename>_DTKSH_WORKING_DIALOG_HANDLE</filename></para>
|
||||
</listitem><listitem><para><filename>_DTKSH_WARNING_DIALOG_HANDLE</filename></para>
|
||||
</listitem><listitem><para><filename>_DTKSH_INFORMATION_DIALOG_HANDLE</filename></para>
|
||||
</listitem></itemizedlist>
|
||||
<note>
|
||||
<para>ダイアログのボタンに独自のコールバックを接続した場合、ダイアログを使用中に
|
||||
破棄しないでください。ダイアログの管理をやめないと、後で再使用されてしまいます。
|
||||
ダイアログの破棄が必要な場合は、関連する環境変数をクリアして、簡易関数が
|
||||
ダイアログを再使用しないようにしてください。</para>
|
||||
</note>
|
||||
<para>使用方法は次のとおりです。</para>
|
||||
<programlisting>DtkshDisplay<<symbol role="Variable">name</symbol>>Dialog title message [okCallback closeCallback
|
||||
helpCallback dialogStyle]</programlisting>
|
||||
<para>[OK]([了解])ボタンは常に管理されていて、デフォルト時にはダイアログを管理しません。
|
||||
[Cancel]([取消し])および[Help]([ヘルプ])ボタンは、コールバックが提供されたときのみ管理されます。
|
||||
<symbol role="Variable">dialogStyle</symbol>パラメータは、関連するブリテン・ボード・リソースがサポートする
|
||||
標準のリソース設定のいずれかを受け入れます。</para>
|
||||
<para>次に例を示します。</para>
|
||||
<programlisting>DtkshDisplayErrorDialog “Read Error“ “Unable to read the file“
|
||||
“OkCallback“ \
|
||||
“CancelCallback“ ““ DIALOG_PRIMARY_APPLICATION_MODAL
|
||||
</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.convf.div.9">
|
||||
<title>DtkshDisplayQuickHelpDialogおよびDtkshDisplayHelpDialog<indexterm><primary>DtkshDisplayQuickHelpDialog</primary></indexterm><indexterm><primary>DtkshDisplayHelpDialog</primary></indexterm></title>
|
||||
<para>これらの簡易関数は、ヘルプ・ダイアログのそれぞれの単一インスタンスを作成します。
|
||||
すでに、要求したヘルプ・ダイアログの型のインスタンスが存在している場合は、それを
|
||||
再使用します。ダイアログの親は、<filename>$TOPLEVEL</filename>環境変数から取得
|
||||
します。これは、シェル・スクリプトによって設定され、その後は変更されません。
|
||||
要求したダイアログのハンドルは、次の環境変数のいずれかを返します。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>_DTKSH_HELP_DIALOG_HANDLE</filename></para>
|
||||
</listitem><listitem><para><filename>_DTKSH_QUICK_HELP_DIALOG_HANDLE</filename></para>
|
||||
</listitem></itemizedlist>
|
||||
<note>
|
||||
<para>ダイアログの破棄が必要な場合は、関連する環境変数をクリアし、簡易関数がダイアログを
|
||||
再使用しないようにしてください。</para>
|
||||
</note>
|
||||
<para>使用方法は次のおとおりです。</para>
|
||||
<programlisting>DtkshDisplay*HelpDialog title helpType helpInformation [locationId]
|
||||
</programlisting>
|
||||
<para>パラメータの意味は、<symbol role="Variable">helpType</symbol>パラメータに指定した値に依存します。
|
||||
意味は次のとおりです。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><symbol role="Variable">helpType</symbol> = <filename>HELP_TYPE_TOPIC</filename></para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><symbol role="Variable">helpInformation</symbol> = ヘルプ・ボリューム名</para>
|
||||
</listitem><listitem><para><symbol role="Variable">locationId</symbol> = ヘルプ・トピック位置ID</para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><symbol role="Variable">helpType</symbol> = <filename>HELP_TYPE_STRING</filename></para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><symbol role="Variable">helpInformation</symbol> = ヘルプ文字列</para>
|
||||
</listitem><listitem><para><symbol role="Variable">locationId</symbol> = <未使用></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><symbol role="Variable">helpType</symbol> = <filename>HELP_TYPE_DYNAMIC_STRING</filename></para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><symbol role="Variable">helpInformation</symbol> = ヘルプ文字列</para>
|
||||
</listitem><listitem><para><symbol role="Variable">locationId</symbol> = <未使用></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><symbol role="Variable">helpType</symbol> = <filename>HELP_TYPE_MAN_PAGE</filename></para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><symbol role="Variable">helpInformation</symbol> = マニュアル・ページ名</para>
|
||||
</listitem><listitem><para><symbol role="Variable">locationId</symbol> = <未使用></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><symbol role="Variable">helpType</symbol> = <filename>HELP_TYPE_FILE</filename></para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><symbol role="Variable">helpInformation</symbol> = ヘルプ・ファイル名</para>
|
||||
</listitem><listitem><para><symbol role="Variable">locationId</symbol> = <未使用></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem></itemizedlist>
|
||||
<para>Example:</para>
|
||||
<programlisting>DtkshDisplayHelpDialog “Help On Dtksh“ HELP_TYPE_FILE
|
||||
“helpFileName“</programlisting>
|
||||
</sect1>
|
||||
</appendix>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub Caret>
|
||||
<?Pub *0000017940>
|
||||
404
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/appc.sgm
Normal file
404
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/appc.sgm
Normal file
@@ -0,0 +1,404 @@
|
||||
<!-- $XConsortium: appc.sgm /main/7 1996/09/08 19:45:21 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<appendix id="DKSUG.finds.div.1">
|
||||
<title>The script_findスクリプト</title>
|
||||
<para>この付録には、第4章「複雑なスクリプト」で説明されている<filename>script_find</filename>の全リストが
|
||||
掲載されています。このスクリプトは、<indexterm><primary>script_find</primary></indexterm><filename>script_find</filename>の後にリストされている<filename>Find.sticky</filename>と呼ばれるという従属的な
|
||||
スクリプトを実行します。
|
||||
メイン・スクリプト・ウィンドウの[ヘルプ]ボタンをクリックするとアクセスされる<filename>Find.help</filename>と呼ばれるテキスト・フィールドもあります。
|
||||
このスクリプトのより詳細な情報は、第4章を参照してください。
|
||||
</para>
|
||||
<sect1 id="DKSUG.finds.div.2">
|
||||
<title>script_findのリスト</title>
|
||||
<programlisting>#! /usr/dt/bin/dtksh
|
||||
set -u
|
||||
|
||||
. /usr/dt/lib/dtksh/DtFuncs.dtsh
|
||||
|
||||
#
|
||||
# This sample shell script provides a graphical interface to the
|
||||
# `find' command. Each time it is executed, it will attempt to
|
||||
# restore the dialog to the last set of values entered by the user.
|
||||
# When the `find' command is initiated, the output will be displayed
|
||||
# in a dtterm window.
|
||||
#
|
||||
|
||||
#
|
||||
# Post an# error dialog. The main application window is disabled
|
||||
# until the error dialog is unposted. The message to be displayed
|
||||
# in the # error dialog is passed in as $1
|
||||
#
|
||||
PostErrorDialog()
|
||||
{
|
||||
DtDisplayErrorDialog “Find Error” “$1” \
|
||||
DIALOG_PRIMARY_APPLICATION_MODAL
|
||||
}
|
||||
|
||||
#
|
||||
# This is both the `Ok' and the `Apply' callback; in the case of the
|
||||
# `Ok' callback, it unposts the main application window, and then
|
||||
# exits, if the dialog contains valid information. For both `Ok' and
|
||||
# `Apply', the set of search directories is first validated; if any
|
||||
# of the paths are not valid, then an error dialog is posted.
|
||||
# Otherwise, the `find' process is started in a terminal window.
|
||||
#
|
||||
OkCallback()
|
||||
{
|
||||
RetrieveAndSaveCurrentValues
|
||||
if [ “$SD_VAL” = ““ ]; then
|
||||
PostErrorDialog “You must specify a directory to search”
|
||||
else
|
||||
for i in $SD_VAL; do
|
||||
if [ ! -d $i ]; then
|
||||
MSG=”The following search directory does not exist:
|
||||
|
||||
$i”
|
||||
PostErrorDialog “$MSG”
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $CB_WIDGET = $OK ]; then
|
||||
XtPopdown $TOPLEVEL
|
||||
fi
|
||||
|
||||
CMD=”/bin/find $SD_VAL”
|
||||
if [ ! “$FNP_VAL” = ““ ]; then
|
||||
CMD=$CMD” -name $FNP_VAL”
|
||||
fi
|
||||
|
||||
if ! $(XmToggleButtonGetState $T1); then
|
||||
CMD=$CMD” -xdev”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T3); then
|
||||
CMD=$CMD” -hidden”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T4); then
|
||||
CMD=$CMD” -follow”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T5); then
|
||||
CMD=$CMD” -depth”
|
||||
fi
|
||||
|
||||
case $FSTYPE_VAL in
|
||||
$NFS) CMD=$CMD” -fsonly nfs” ;;
|
||||
$CDFS) CMD=$CMD” -fsonly cdfs” ;;
|
||||
$HFS) CMD=$CMD” -fsonly hfs” ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
case $FILETYPE_VAL in
|
||||
$REGULAR) CMD=$CMD” -type f” ;;
|
||||
$DIRECTORY) CMD=$CMD” -type d” ;;
|
||||
$BLOCK) CMD=$CMD” -type b” ;;
|
||||
$CHAR) CMD=$CMD” -type c” ;;
|
||||
$FIFO) CMD=$CMD” -type p” ;;
|
||||
$SYMLINK) CMD=$CMD” -type l” ;;
|
||||
$SOCKET) CMD=$CMD” -type s” ;;
|
||||
$NET) CMD=$CMD” -type n” ;;
|
||||
$MOUNT) CMD=$CMD” -type M” ;;
|
||||
$HIDDEN) CMD=$CMD” -type H” ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
if $(XmToggleButtonGetState $T2); then
|
||||
CMD=$CMD” -print”
|
||||
fi
|
||||
|
||||
/usr/dt/bin/dtterm -title “Find A File” -e /usr/dt/bin/dtexec
|
||||
-open -1 $CMD &
|
||||
|
||||
if [ $CB_WIDGET = $OK ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# This function attempts to load in the previous dialog values.
|
||||
# Each line read from the file is then interpreted as a ksh command.
|
||||
#
|
||||
LoadStickyValues()
|
||||
{
|
||||
if [ -r “./Find.sticky” ]; then
|
||||
exec 6< “./Find.sticky”
|
||||
XtAddInput FID 6 “EvalCmd”
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# This function is invoked for each line in the `sticky' values file.
|
||||
# It will evalutate each line as a dtksh command.
|
||||
#
|
||||
EvalCmd()
|
||||
{
|
||||
if [ ${#INPUT_LINE} -gt 0 ]; then
|
||||
eval “$INPUT_LINE”
|
||||
fi
|
||||
|
||||
if [ “$INPUT_EOF” = `true' ]; then
|
||||
XtRemoveInput $INPUT_ID
|
||||
eval exec $INPUT_SOURCE'<&-'
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# This function retrieves the current values, and then saves them
|
||||
# off into a file, so that they can be restored the next time the
|
||||
# dialog is displayed. It is called anytime the user selects either
|
||||
# the “Ok” or “Apply” buttons.
|
||||
#
|
||||
RetrieveAndSaveCurrentValues()
|
||||
{
|
||||
XmTextGetString SD_VAL $SD
|
||||
XmTextGetString FNP_VAL $FNP
|
||||
XtGetValues $FSTYPE menuHistory:FSTYPE_VAL
|
||||
XtGetValues $FILETYPE menuHistory:FILETYPE_VAL
|
||||
|
||||
exec 3> “./Find.sticky”
|
||||
if [ ! “$SD_VAL” = ““ ]; then
|
||||
print -u 3 “XmTextSetString \$SD \”$SD_VAL\””
|
||||
print -u 3 “XmTextFieldSetInsertionPosition \$SD ${#SD_VAL}”
|
||||
fi
|
||||
if [ ! “$FNP_VAL” = ““ ]; then
|
||||
print -u 3 “XmTextSetString \$FNP \”$FNP_VAL\””
|
||||
print -u 3 “XmTextFieldSetInsertionPosition \$FNP ${#FNP_VAL}”
|
||||
fi
|
||||
|
||||
case $FSTYPE_VAL in
|
||||
$NFS) FST=”\$NFS” ;;
|
||||
$CDFS) FST=”\$CDFS” ;;
|
||||
$HFS) FST=”\$HFS” ;;
|
||||
*) FST=”\$NODIR” ;;
|
||||
esac
|
||||
print -u 3 “XtSetValues \$FSTYPE menuHistory:$FST”
|
||||
|
||||
case $FILETYPE_VAL in
|
||||
$REGULAR) FT=”\$REGULAR” ;;
|
||||
$DIRECTORY) FT=”\$DIRECTORY” ;;
|
||||
$BLOCK) FT=”\$BLOCK” ;;
|
||||
$CHAR) FT=”\$CHAR” ;;
|
||||
$FIFO) FT=”\$FIFO” ;;
|
||||
$SYMLINK) FT=”\$SYMLINK” ;;
|
||||
$SOCKET) FT=”\$SOCKET” ;;
|
||||
$NET) FT=”\$NET” ;;
|
||||
$MOUNT) FT=”\$MOUNT” ;;
|
||||
$HIDDEN) FT=”\$HIDDEN” ;;
|
||||
*) FT=”\$NOTYPE” ;;
|
||||
esac
|
||||
print -u 3 “XtSetValues \$FILETYPE menuHistory:$FT”
|
||||
|
||||
if $(XmToggleButtonGetState $T1); then
|
||||
print -u 3 “XmToggleButtonSetState \$T1 true false”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T2); then
|
||||
print -u 3 “XmToggleButtonSetState \$T2 true false”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T3); then
|
||||
print -u 3 “XmToggleButtonSetState \$T3 true false”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T4); then
|
||||
print -u 3 “XmToggleButtonSetState \$T4 true false”
|
||||
fi
|
||||
|
||||
if $(XmToggleButtonGetState $T5); then
|
||||
print -u 3 “XmToggleButtonSetState \$T5 true false”
|
||||
fi
|
||||
|
||||
exec 3<&-
|
||||
}
|
||||
|
||||
|
||||
################ Create the Main UI ####################
|
||||
|
||||
set -f
|
||||
XtInitialize TOPLEVEL find Dtksh $0 “${@:-}”
|
||||
XtSetValues $TOPLEVEL title:”Find Files”
|
||||
|
||||
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
|
||||
|
||||
XtCreateManagedWidget SDLABEL sdlabel XmLabel $FORM \
|
||||
labelString:”Search Directory:” \
|
||||
$(DtkshAnchorTop 12) \
|
||||
$(DtkshAnchorLeft 10)
|
||||
|
||||
XtCreateManagedWidget SD sd XmText $FORM \
|
||||
columns:30 \
|
||||
value:”.” \
|
||||
$(DtkshAnchorTop 6) \
|
||||
$(DtkshRightOf $SDLABEL 10) \
|
||||
$(DtkshAnchorRight 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
XmTextFieldSetInsertionPosition $SD 1
|
||||
|
||||
XtCreateManagedWidget FNPLABEL fnpabel XmLabel $FORM \
|
||||
labelString:”Filename Pattern:” \
|
||||
$(DtkshUnder $SDLABEL 24) \
|
||||
$(DtkshAnchorLeft 10)
|
||||
|
||||
XtCreateManagedWidget FNP fnp XmText $FORM \
|
||||
columns:30 \
|
||||
$(DtkshUnder $SD 8) \
|
||||
$(DtkshRightOf $FNPLABEL 10) \
|
||||
$(DtkshAnchorRight 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
|
||||
XtCreateManagedWidget SEP sep XmSeparator $FORM \
|
||||
separatorType:SINGLE_DASHED_LINE \
|
||||
$(DtkshUnder $FNP 10) \
|
||||
$(DtkshSpanWidth)
|
||||
|
||||
XtCreateManagedWidget RC rc XmRowColumn $FORM \
|
||||
orientation:HORIZONTAL \
|
||||
numColumns:3 \
|
||||
packing:PACK_COLUMN \
|
||||
$(DtkshUnder $SEP 10) \
|
||||
$(DtkshSpanWidth 10 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
|
||||
DtkshAddButtons -w $RC XmToggleButtonGadget \
|
||||
T1 “Cross Mount Points” ““\
|
||||
T2 “Print Matching Filenames” ““\
|
||||
T3 “Search Hidden Subdirectories” ““\
|
||||
T4 “Follow Symbolic Links” ““\
|
||||
T5 “Descend Subdirectories First” ““
|
||||
|
||||
XtCreateManagedWidget SEP2 sep XmSeparator $FORM \
|
||||
separatorType:SINGLE_DASHED_LINE \
|
||||
$(DtkshUnder $RC 10) \
|
||||
$(DtkshSpanWidth)
|
||||
|
||||
XmCreatePulldownMenu PANE $FORM pane
|
||||
DtkshAddButtons -w $PANE XmPushButtonGadget \
|
||||
NODIR “no restrictions” ““\
|
||||
NFS “nfs” ““\
|
||||
CDFS “cdfs” ““\
|
||||
HFS “hfs” ““
|
||||
|
||||
XmCreateOptionMenu FSTYPE $FORM fstype \
|
||||
labelString:”Restrict Search To File System Type:” \
|
||||
menuHistory:$NODIR \
|
||||
subMenuId:$PANE \
|
||||
$(DtkshUnder $SEP2 20) \
|
||||
$(DtkshSpanWidth 10 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
XtManageChild $FSTYPE
|
||||
|
||||
XmCreatePulldownMenu PANE2 $FORM pane2
|
||||
DtkshAddButtons -w $PANE2 XmPushButtonGadget \
|
||||
NOTYPE “no restrictions” ““\
|
||||
REGULAR “regular” ““\
|
||||
DIRECTORY “directory” ““\
|
||||
BLOCK “block special” ““\
|
||||
CHAR “character special” ““\
|
||||
FIFO “fifo” ““\
|
||||
SYMLINK “symbolic link” ““\
|
||||
SOCKET “socket” ““\
|
||||
NET “network special” ““\
|
||||
MOUNT “mount point” ““\
|
||||
HIDDEN “hidden directory” ““
|
||||
|
||||
XmCreateOptionMenu FILETYPE $FORM filetype \
|
||||
labelString:”Match Only Files Of Type:” \
|
||||
menuHistory:$NOTYPE \
|
||||
subMenuId:$PANE2 \
|
||||
$(DtkshUnder $FSTYPE 10) \
|
||||
$(DtkshSpanWidth 10 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
XtManageChild $FILETYPE
|
||||
XtSetValues $FILETYPE spacing:90
|
||||
|
||||
XtCreateManagedWidget SEP3 sep3 XmSeparator $FORM \
|
||||
$(DtkshUnder $FILETYPE 10) \
|
||||
$(DtkshSpanWidth)
|
||||
|
||||
XtCreateManagedWidget OK ok XmPushButton $FORM \
|
||||
labelString:”Ok” \
|
||||
$(DtkshUnder $SEP3 10) \
|
||||
$(DtkshFloatLeft 4) \
|
||||
$(DtkshFloatRight 24) \
|
||||
$(DtkshAnchorBottom 10)
|
||||
XtAddCallback $OK activateCallback “OkCallback”
|
||||
|
||||
XtCreateManagedWidget APPLY apply XmPushButton $FORM \
|
||||
labelString:”Apply” \
|
||||
$(DtkshUnder $SEP3 10) \
|
||||
$(DtkshFloatLeft 28) \
|
||||
$(DtkshFloatRight 48) \
|
||||
$(DtkshAnchorBottom 10)
|
||||
XtAddCallback $APPLY activateCallback “OkCallback”
|
||||
|
||||
XtCreateManagedWidget CLOSE close XmPushButton $FORM \
|
||||
labelString:”Close” \
|
||||
$(DtkshUnder $SEP3 10) \
|
||||
$(DtkshFloatLeft 52) \
|
||||
$(DtkshFloatRight 72) \
|
||||
$(DtkshAnchorBottom 10)
|
||||
XtAddCallback $CLOSE activateCallback “exit 1”
|
||||
|
||||
XtCreateManagedWidget HELP help XmPushButton $FORM \
|
||||
labelString:”Help” \
|
||||
$(DtkshUnder $SEP3 10) \
|
||||
$(DtFloatLeft 76) \
|
||||
$(DtkshFloatRight 96) \
|
||||
$(DtkshAnchorBottom 10)
|
||||
XtAddCallback $HELP activateCallback \
|
||||
“DtkshDisplayQuickHelpDialog `Using The Find Command'
|
||||
HELP_TYPE_FILE \
|
||||
`./Find.help' “
|
||||
|
||||
XtSetValues $FORM \
|
||||
initialFocus:$SD \
|
||||
defaultButton:$OK \
|
||||
cancelButton:$CLOSE \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
|
||||
DtkshSetReturnKeyControls $SD $FNP $FORM $OK
|
||||
LoadStickyValues
|
||||
|
||||
XtRealizeWidget $TOPLEVEL
|
||||
XtMainLoop</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.finds.div.3">
|
||||
<title>Find.sticky</title>
|
||||
<para>次のスクリプト<indexterm><primary>Find.sticky</primary></indexterm><filename>Find.sticky</filename>は、<filename>script_find</filename>によって実行されます。
|
||||
<filename>Find.sticky</filename>は、最も最近に<filename>script_find</filename>を実行した時に
|
||||
使用したファイルとディレクトリ名を記録します。</para>
|
||||
<programlisting>XmTextSetString $SD “/users/dlm”
|
||||
XmTextFieldSetInsertionPosition $SD 10
|
||||
XmTextSetString $FNP “elmbug”
|
||||
XmTextFieldSetInsertionPosition $FNP 6
|
||||
XtSetValues $FSTYPE menuHistory:$NODIR
|
||||
XtSetValues $FILETYPE menuHistory:$DIRECTORY
|
||||
XmToggleButtonSetState $T1 true false
|
||||
XmToggleButtonSetState $T2 true false</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.finds.div.4">
|
||||
<title>Find.help</title>
|
||||
<para><filename>Find.help</filename>は、メインの<filename>script_find</filename>ウィンドウの[ヘルプ]ボタンを
|
||||
クリックすると画面に表示されるテキスト・ファイルです。</para>
|
||||
<programlisting>This dialog presents a graphical interface to the
|
||||
UNIX `find' command. The only required field is
|
||||
the name of the directory to be searched;
|
||||
all other fields are optional. Once the fields have
|
||||
been set to the desired values, you can use the
|
||||
`Ok' or `Apply' button to initiate the find operation.
|
||||
The results of the find operation are displayed
|
||||
in a dtterm terminal window.</programlisting>
|
||||
</sect1>
|
||||
</appendix>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub Caret>
|
||||
<?Pub *0000015484>
|
||||
66
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/book.sgm
Normal file
66
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/book.sgm
Normal file
@@ -0,0 +1,66 @@
|
||||
<!-- $XConsortium: book.sgm /main/2 1996/12/17 05:35:58 cde-hit $ -->
|
||||
<!DOCTYPE Book PUBLIC "-//HaL and O'Reilly//DTD DocBook//EN" [
|
||||
|
||||
|
||||
<!ENTITY % ISOpublishing PUBLIC "ISO 8879-1986//ENTITIES Publishing//EN">
|
||||
%ISOpublishing;
|
||||
|
||||
<!ENTITY % ISOnumeric PUBLIC "ISO 8879-1986//ENTITIES Numeric and Special Graphic//EN">
|
||||
%ISOnumeric;
|
||||
|
||||
<!ENTITY % ISOdiacritical PUBLIC "ISO 8879-1986//ENTITIES Diacritical Marks//EN">
|
||||
%ISOdiacritical;
|
||||
|
||||
<!ENTITY % ISOgeneraltech PUBLIC "ISO 8879-1986//ENTITIES General Technical//EN">
|
||||
%ISOgeneraltech;
|
||||
|
||||
<!ENTITY % ISOalatin1 PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN">
|
||||
%ISOalatin1;
|
||||
|
||||
<!ENTITY % ISOalatin2 PUBLIC "ISO 8879-1986//ENTITIES Added Latin 2//EN">
|
||||
%ISOalatin2;
|
||||
|
||||
<!ENTITY % ISOgreek PUBLIC "ISO 8879-1986//ENTITIES Greek Symbols//EN">
|
||||
%ISOgreek;
|
||||
|
||||
<!ENTITY % ISOboxandline PUBLIC "ISO 8879-1986//ENTITIES Box and Line Drawing//EN">
|
||||
%ISOboxandline;
|
||||
|
||||
|
||||
<!ENTITY % BEntities SYSTEM "./dtkshGuide/BEntity.sgm">
|
||||
%BEntities;
|
||||
|
||||
<!ENTITY % local.notations "| XPM | XBM | XWD">
|
||||
<!NOTATION XPM SYSTEM "XPM">
|
||||
<!NOTATION XBM SYSTEM "XBM">
|
||||
<!NOTATION XWD SYSTEM "XWD">
|
||||
|
||||
<!ENTITY Pref SYSTEM "./dtkshGuide/preface.sgm">
|
||||
<!ENTITY Intro SYSTEM "./dtkshGuide/ch01.sgm">
|
||||
<!ENTITY scr1 SYSTEM "./dtkshGuide/ch02.sgm">
|
||||
<!ENTITY adv SYSTEM "./dtkshGuide/ch03.sgm">
|
||||
<!ENTITY scr2 SYSTEM "./dtkshGuide/ch04.sgm">
|
||||
<!ENTITY cmds SYSTEM "./dtkshGuide/appa.sgm">
|
||||
<!ENTITY convf SYSTEM "./dtkshGuide/appb.sgm">
|
||||
<!ENTITY finds SYSTEM "./dtkshGuide/appc.sgm">
|
||||
|
||||
|
||||
|
||||
]>
|
||||
|
||||
<!-- ____________________________________________________________________________ -->
|
||||
|
||||
<Book>
|
||||
|
||||
<Title>共通デスクトップ環境 デスクトップ KornShell ユーザーズ・ガイド</Title>
|
||||
|
||||
&Pref;
|
||||
&Intro;
|
||||
&scr1;
|
||||
&adv;
|
||||
&scr2;
|
||||
&cmds;
|
||||
&convf;
|
||||
&finds;
|
||||
|
||||
</Book>
|
||||
482
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch01.sgm
Normal file
482
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch01.sgm
Normal file
@@ -0,0 +1,482 @@
|
||||
<!-- $XConsortium: ch01.sgm /main/7 1996/09/08 19:45:34 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<chapter id="DKSUG.Intro.div.1">
|
||||
<title id="DKSUG.Intro.mkr.1">デスクトップKornShellの紹介</title>
|
||||
<para>デスクトップ KornShell(<command>ldtksh<indexterm><primary>dtksh</primary>
|
||||
<secondary>定義</secondary></indexterm></command>)は、ほとんどの既存のXtやMotif™関数に簡単にアクセスするための手段をもつ
|
||||
kshellスクリプトを提供します。<command>dtksh</command>は、<filename>ksh-93</filename><indexterm>
|
||||
<primary>dtksh</primary><secondary>ksh-93との関係</secondary></indexterm><indexterm><primary>ksh-93</primary>
|
||||
</indexterm>を基にしています。
|
||||
<command>dtksh</command>は、シェル・プログラマにとって有効なツールおよびコマンドのセットを
|
||||
提供しており、標準的なkshellプログラミング・コマンドのセットをサポートしています。</para>
|
||||
<para><command>dtksh</command>は、<filename>ksh-93</filename>が提供しているすべての機能およびコマンドを
|
||||
サポートしています。 <command>dtksh</command>は、<command>libDt</command>関数の数多くの選択、ウィジェット関連の
|
||||
ほとんどのMotif関数、Xtイントリンシクスの多数のサブセット、Xlib関数の少数の
|
||||
サブセットをサポートしています。サポートされている関数のすべてのリストは、付録Aに
|
||||
記載されています。<indexterm><primary>サポート関数</primary></indexterm><indexterm>
|
||||
<primary>関数</primary><secondary>サポート関数</secondary></indexterm></para>
|
||||
<sect1 id="DKSUG.Intro.div.2">
|
||||
<title>デスクトップKornShellでMotifアプリケーションを作成するには</title>
|
||||
<para>この節では、<command>dtksh</command>を使って、Motifアプリケーションを作成する方法<indexterm><primary>Motifアプリケーション</primary></indexterm><indexterm>
|
||||
<primary>>Motifアプリケーション</primary></indexterm>を説明します。
|
||||
<command>dtksh</command>をうまく使用するには、 Xlib、Xtイントリンシクス、Motifウィジェット、
|
||||
およびKornShellプログラミングの経験は必要です。Cプログラミング言語について知っていることも役に
|
||||
立ちます。これらを熟知していないときは、適切なドキュメントを参照して
|
||||
ください。これらのシステムを熟知している場合も、適切なマニュアル・ページに
|
||||
アクセスし、参照してください。</para>
|
||||
<para>システムには、以下のようなライブラリがあります。<indexterm><primary>必要なライブラリ</primary></indexterm><indexterm><primary>必要なライブラリ</primary></indexterm></para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><command>libDtHelp</command></para>
|
||||
</listitem><listitem><para><command>libDtSvc</command></para>
|
||||
</listitem><listitem><para><command>libX11</command></para>
|
||||
</listitem><listitem><para><command>libXm</command></para>
|
||||
</listitem><listitem><para><command>libXt</command></para>
|
||||
</listitem><listitem><para><command>libtt</command></para>
|
||||
</listitem></itemizedlist>
|
||||
<sect2 id="DKSUG.Intro.div.3">
|
||||
<title>リソース<indexterm><primary>リソース</primary></indexterm></title>
|
||||
<para>リソースはサイズ、位置、またはカラーなどの属性を定義するのに使用するウィジェット
|
||||
の変数です。通常、各ウィジェットがもつリソースは、自身のリソースにより高いレベル
|
||||
のウィジェットから引き継ぐリソースを加えたものです。Xtイントリンシクス
|
||||
およびMotifリソース名は接頭辞(<command>XtN</command>または<command>XmN</command>)の後にベース名が続く構成に
|
||||
成っています。
|
||||
ベース名の最初の文字は、<emphasis>常に</emphasis>小文字です。ベース名内の後続の単語の最初の文字は、
|
||||
<emphasis>常に</emphasis>大文字です。<command>dtksh</command>スクリプトのリソース名は、接頭辞を
|
||||
削除して、残ったベース名を使用します。
|
||||
例えば<command>XmNtopShadowColor</command>は<command>topShadowColor</command>になります。</para>
|
||||
<para>いくつかのXtおよびMotifコマンドは、シェル・スクリプトがリソースとそのiリソース値のペアを表す
|
||||
パラメータの変数を渡せます。<indexterm>
|
||||
<primary>パラメータの変数</primary>
|
||||
</indexterm>これは、引数のリストが、対応するXtまたはMotifのC言語の関数に渡される
|
||||
のに似ています。例えば、コマンドのいくつかを使用してウィジェットを作成し、
|
||||
<command>XtSetValues</command>コマンドを追加します。<command>dtksh</command>で、リソースは次の構文をもつ
|
||||
文字列で指定されます。</para>
|
||||
<programlisting>resource:<symbol role="Variable">value</symbol></programlisting>
|
||||
|
||||
<para><symbol role="Variable">resource</symbol>はリソース名、<symbol role="Variable">value</symbol>はリソースに割り当てられた値です。
|
||||
<command>dtksh</command>は、適切な内部表現に<symbol role="Variable">value</symbol>文字列を自動的に変換します。例えば次のとおりです。
|
||||
</para>
|
||||
<programlisting>XtSetValues $WIDGET height:100 width:200 resizePolicy:RESIZE_ANY
|
||||
XmCreateLabel LABEL $PARENT myLabel labelString:”Close Dialog”
|
||||
</programlisting>
|
||||
<para><command><indexterm><primary>XtGetValues</primary></indexterm>XtGetValues</command>を使用してウィジェットのリソース値を検索するとき、戻り値は、環境変数にi置かれます。
|
||||
したがって、<command>dtksh</command>版の<command>XtGetValues</command>は、
|
||||
名前と値のペアではなく、名前と(環境)変数のペアを使用します(Xtイントリンシクスと異なります)。
|
||||
例えば、次のとおりです。
|
||||
</para>
|
||||
<programlisting>XtGetValues $WIDGET height:HEIGHT resizePolicy:POLICY
|
||||
sensitive:SENSITIVE
|
||||
echo $HEIGHT
|
||||
echo $POLICY
|
||||
echo $SENSITIVE</programlisting>
|
||||
<para>前述の<command>dtksh</command>セグメントは、次のような出力を行います。
|
||||
</para>
|
||||
<programlisting>100
|
||||
RESIZE ANY
|
||||
TRUE</programlisting>
|
||||
<para>文字テーブルおよびビット・マスクを含むあるタイプのリソース値は、特別な表現に
|
||||
なります。例えば、リスト・ウィジェットは、文字テーブルに、<command>items</command>および
|
||||
<command>selectedItems</command>の両方を指定できます。<command>dtksh</command>で、文字テーブルは、カンマで区切られた文字列のリストで表現されます。これ
|
||||
は、Motifが文字テーブルを取り扱う方法と似ています。
|
||||
文字テーブルを返すリソースを<command>XtGetValues<indexterm><primary>XtGetValues</primary>
|
||||
</indexterm></command>で問い合わせたとき、
|
||||
その結果の値はカンマで区切られた文字列のセットになります。
|
||||
</para>
|
||||
<para>ビット・マスク値で渡されるリソースは、マスク値を|(バー)文字で区切られた様々な
|
||||
マスク値から成る文字列として指定します。ビット・マスクを返すリソースを問い合わせ
|
||||
たとき、戻り値は、|文字で区切られたビットを表現した文字列になります。例えば、
|
||||
<command>VendorShell</command>ウィジェット・クラスの<command><indexterm><primary>mwmFunctions</primary></indexterm><indexterm><primary>VendorShell</primary></indexterm>mwmFunctions</command>リソースを設定するには次のコマンドを使用します。</para>
|
||||
<programlisting>XtSetValues mwmFunctions: MWM_FUNC_ALL|MWM_FUNC_RESIZE</programlisting>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.Intro.div.4">
|
||||
<title>サポートしていないリソース<indexterm><primary>サポートしていないリソース</primary>
|
||||
</indexterm><indexterm><primary>リソース</primary><secondary>サポートしていないリソース</secondary></indexterm></title>
|
||||
<para><command>dtksh</command>は、ほとんどのMotifリソースをサポートしています。次のリストは、サポート
|
||||
していないリソースです。 *(アスタリスク)のついたリソースは、<command>XtSetValues</command>を使用して
|
||||
ウィジェットを作成できますが、 <command><indexterm><primary>XtGetValues</primary></indexterm>XtGetValues</command>を使用して検索すること
|
||||
はできません。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para>すべてのウィジェットおよびガジェットのクラス:
|
||||
</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para>任意のfontlistリソース *</para>
|
||||
</listitem><listitem><para>任意のpixmapリソース *</para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para>コンポジット:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>insertPosition</command></para>
|
||||
</listitem><listitem><para><command>children</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para>コア:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>accelerators</command></para>
|
||||
</listitem><listitem><para><command>translations</command> *</para>
|
||||
</listitem><listitem><para><command>colormap</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>XmText</command>:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>selectionArray</command></para>
|
||||
</listitem><listitem><para><command>selectionArrayCount</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>アプリケーション・シェル</command>:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>argv</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>WMShell</command>:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>iconWindow</command></para>
|
||||
</listitem><listitem><para><command>windowGroup</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>シェル</command>:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>createPopupChildrenProc</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>XmSelectionBox</command>:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>textAccelerators</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>マネージャ</command>、<command>プリミティブ</command>、および<command>ガジェット</command>サブクラス:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>userData</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem><listitem><para><command>XmFileSelectionBox</command>:</para>
|
||||
<itemizedlist remap="Bullet2"><listitem><para><command>dirSearchProc</command></para>
|
||||
</listitem><listitem><para><command>fileSearchProc</command></para>
|
||||
</listitem><listitem><para><command>qualifySearchDataProc</command></para>
|
||||
</listitem></itemizedlist>
|
||||
</listitem></itemizedlist>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.Intro.div.5">
|
||||
<title>dtksh app-defaultsファイル<indexterm><primary>app-defaultsファイル</primary>
|
||||
</indexterm></title>
|
||||
<para><command>dtksh</command>の<filename>app-defaults</filename>ファイルは、<command>Dtksh</command><indexterm><primary>Dtksh app-defaultsファイル</primary></indexterm>という名前で、次のパス表示を基づいた位置にあります。</para>
|
||||
<programlisting>/usr/dt/app-defaults/<LANG></programlisting>
|
||||
<para>この<filename>app-defaults</filename>ファイルにある情報は、標準的な<command>Dt</command>ベースの<filename>app-defaults</filename>ファイルに
|
||||
含まれているもののみです。<command>dtksh</command>の<filename>app-defaults</filename>ファイルのリストは次のとおりです。</para>
|
||||
<programlisting>#include “Dt“</programlisting>
|
||||
<para><command>Dt</command>ファイルは、 <computeroutput>/usr/dt/app-defaults/<LANG></computeroutput>にあり、次のようなリストで示されています。</para>
|
||||
<programlisting>*foregroundThreshold: 70
|
||||
!###
|
||||
!#
|
||||
!# Help system specific resources
|
||||
!#
|
||||
!###
|
||||
|
||||
!#
|
||||
!# Display Area Colors
|
||||
!#
|
||||
!# These resources set the colors for the display area (where
|
||||
!# actual help text is displayed). The resources are complex
|
||||
!# because they have to override the standard color resources
|
||||
!# in all cases.
|
||||
!#
|
||||
*XmDialogShell.DtHelpDialog*DisplayArea.background: White
|
||||
*XmDialogShell*XmDialogShell.DtHelpDialog*DisplayArea.background:
|
||||
White
|
||||
*XmDialogShell.DtHelpDialog*DisplayArea.foreground: Black
|
||||
*XmDialogShell*XmDialogShell.DtHelpDialog*DisplayArea.foreground:
|
||||
Black
|
||||
|
||||
!#
|
||||
!# Menu Accelerators
|
||||
!#
|
||||
!# The following resources establish keyboard accelerators
|
||||
!# for the most frequently accessed menu commands.
|
||||
!#
|
||||
|
||||
*DtHelpDialogWidget*searchMenu.keyword.acceleratorText: Ctrl+I
|
||||
*DtHelpDialogWidget*searchMenu.keyword.accelerator: Ctrl<Key>i
|
||||
*DtHelpDialogWidget*navigateMenu.backTrack.acceleratorText: Ctrl+B
|
||||
*DtHelpDialogWidget*navigateMenu.backTrack.accelerator: Ctrl<Key>b
|
||||
*DtHelpDialogWidget*navigateMenu.homeTopic.acceleratorText: Ctrl+H
|
||||
*DtHelpDialogWidget*navigateMenu.homeTopic.accelerator: Ctrl<Key>h
|
||||
*DtHelpDialogWidget*fileMenu.close.acceleratorText: Alt+F4
|
||||
*DtHelpDialogWidget*fileMenu.close.accelerator: Alt<Key>f4</programlisting>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.Intro.div.6">
|
||||
<title>変数の値<indexterm><primary>変数の値</primary></indexterm></title>
|
||||
<para>この節は、<command>dtksh</command><filename>app-defaults</filename>ファイルの変数の値の型について説明します。</para>
|
||||
<sect3 id="DKSUG.Intro.div.7">
|
||||
<title>定義値<indexterm><primary>定義値</primary></indexterm></title>
|
||||
<para>X、XtおよびMotifに対するインタフェースのCバインディングは、文字列ではない値
|
||||
(ヘッダ・ファイルで定義されている)を多く含んでいます。このような値の一般的な形式
|
||||
は、 <command>Xt</command>または<command>Xm</command>接頭辞の後に、説明的な名前が続く形式に
|
||||
なっています。例えば、フォーム・ウィジェットの子の制約値の1つに<filename>XmATTACH_FORM</filename>が
|
||||
あります。接頭辞を取り去ることによって、Motifデフォルト・ファイルで指定するのと
|
||||
同等の値を、<command>dtksh</command>に指定できます。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>XmDIALOG_COMMAND_TEXT</filename>
|
||||
は、<filename>DIALOG_COMMAND_TEXT</filename>になります。</para>
|
||||
</listitem><listitem><para><filename>XtATTACH_FORM</filename>
|
||||
は、<filename>ATTACH_FORM</filename>になります。</para>
|
||||
</listitem></itemizedlist>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.Intro.div.8">
|
||||
<title>ブール値<indexterm><primary>ブール値</primary></indexterm></title>
|
||||
<para><command>dtksh</command>コマンドのパラメータとしてTrueまたはFalseを使用してブール値を指定できます。
|
||||
大文字、小文字は関係ありません。
|
||||
結果は、trueまたはfalse(すべて小文字が使用されます。)のいずれかが返されます。
|
||||
</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.Intro.div.9">
|
||||
<title>戻り値<indexterm><primary>戻り値</primary></indexterm></title>
|
||||
<para><command>dtksh</command>のグラフィカル・コマンドは、対応するC関数の定義に基づいて、4つのカテゴリの
|
||||
1つに分類されています。</para>
|
||||
<orderedlist><listitem><para>関数はvoidで、値を返しません。
|
||||
例:<filename>XtMapWidget()</filename></para>
|
||||
</listitem><listitem><para>関数はvoidですが、関連するパラメータを通して1つ以上の値を返します。
|
||||
例:<filename>XmGetColors()</filename></para>
|
||||
</listitem><listitem><para>関数はブール値以外の値を返します。
|
||||
例:<filename>XtCreateManagedWidget()</filename></para>
|
||||
</listitem><listitem><para>関数はブール値を返します。
|
||||
例: <filename>XtIsSensitive()</filename></para>
|
||||
</listitem></orderedlist>
|
||||
<sect3 id="DKSUG.Intro.div.10">
|
||||
<title>カテゴリ1<indexterm><primary>戻り値</primary><secondary>カテゴリ1</secondary></indexterm></title>
|
||||
<para><command>dtksh</command><indexterm><primary>カテゴリ1</primary>
|
||||
</indexterm>のカテゴリ1のコマンドは、対応するC関数の呼び出しシーケンスに従います。パラメータの
|
||||
数や順序は、関数の標準的なマニュアルを参照して決定してください。
|
||||
例:</para>
|
||||
<programlisting>XtMapWidget $FORM
|
||||
</programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.Intro.div.11">
|
||||
<title>カテゴリ2<indexterm><primary>戻り値</primary><secondary>カテゴリ2</secondary></indexterm></title>
|
||||
<para><command>dtksh</command><indexterm><primary>カテゴリ2</primary></indexterm>のカテゴリ2のコマンドもまた、通常、対応するC関数の呼び出しシーケンスに従います。値を返す
|
||||
ポインタを渡すかわりに環境変数で値を返します。
|
||||
例:</para>
|
||||
<programlisting>XmGetColors $FORM $BG FOREGROUND TOPSHADOW BOTTOMSHADOW SELECT
|
||||
echo “Foreground color = “ $FOREGROUND</programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.Intro.div.12">
|
||||
<title>カテゴリ3<indexterm><primary>戻り値</primary><secondary>カテゴリ3</secondary></indexterm></title>
|
||||
<para><command>dtksh</command><indexterm><primary>カテゴリ3</primary>
|
||||
</indexterm>のコマカテゴリ3のコマンドは、対応するC関数とは少し異なります。C関数は、プロシージャ
|
||||
呼び出しの値としてその値を返しますが、<command>dtksh</command>コマンドはパラメータの追加を要求
|
||||
します。このパラメータは、戻り値が置かれる環境変数の名前です。常に最初のパラメータ
|
||||
になります。
|
||||
例:</para>
|
||||
<programlisting>XmTextGetString TEXT_VALUE $TEXT_WIDGET
|
||||
echo “The value of the text field is “$TEXT_VALUE</programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.Intro.div.13">
|
||||
<title>カテゴリ4<indexterm><primary>戻り値</primary><secondary>カテゴリ4
|
||||
</secondary></indexterm></title>
|
||||
<para><command>dtksh</command><indexterm><primary>カテゴリ4</primary>
|
||||
</indexterm>のカテゴリ4のコマンドは、C関数と同様の条件式で使用できる値を返します。
|
||||
C関数が関連する値を通して(カテゴリ2と同様です)戻り値を返すと、 <command>dtksh</command>コマンド、対応
|
||||
するパラメータの変数名を使用します。
|
||||
例:</para>
|
||||
<programlisting>if XmIsTraversable $PUSH_BUTTON; then
|
||||
echo “The pushbutton is traversable”
|
||||
else
|
||||
echo “The pushbutton is not traversable”
|
||||
fi</programlisting>
|
||||
<para>一般に、カテゴリ3コマンドで記述したものを除いて、コマンドに渡されるパラメータの
|
||||
順番や型は、対応するC関数に渡されるものと一致します。</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.Intro.div.14">
|
||||
<title>直接戻り値<indexterm><primary>戻り値</primary><secondary>直接戻り値</secondary></indexterm><indexterm><primary>直接戻り値</primary></indexterm></title>
|
||||
<para>多くの<indexterm><primary>カテゴリ3</primary></indexterm>カテゴリ3のコマンドは、コマンドの最初のパラメータで指定した環境変数を
|
||||
使って、1つの値を返します(これらの特別なコマンドの最初のパラメータの名前は
|
||||
<symbol role="Variable">variable</symbol>です)。この戻り値が、直接、式で使用されるときは、特別な環境変数
|
||||
ldquor;-„を変数名の代わりに使用することがあります。戻り値が返される
|
||||
環境変数の名前が„-„であるとき、<command>dtksh</command>は、コマンドの値と
|
||||
して結果を返します。これにより、シェル・スクリプトはコマンド呼び出しを別の
|
||||
コマンド呼び出しに含めることができます。この機能は、1つの値を返すコマンドに
|
||||
のみ働き、その値は最初のパラメータに返されます。
|
||||
例:</para>
|
||||
<programlisting>XtDisplay DISPLAY $FORM
|
||||
XSync $DISPLAY true</programlisting>
|
||||
<para>上記は、次のように、同等の状態に置き換えることができます。</para>
|
||||
<programlisting>XSync $(XtDisplay “-“ $FORM) true</programlisting>
|
||||
<para><filename>$DISPLAY</filename>のリファレンスには、<command>XtDisplay</command>が返す値に置き換えられます。</para>
|
||||
<para>これは、ウィジェットを作成するコマンド、複数の値を返すコマンド、最初のパラメータ
|
||||
が名前のない変数であるコマンドを除くすべてのカテゴリ3のコマンドで有効です。
|
||||
環境変数名として„-„を受け入れないコマンドを以下に示します。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>XtInitialize()</filename></para>
|
||||
</listitem><listitem><para><filename>XtCreateApplicationShell()</filename></para>
|
||||
</listitem><listitem><para><filename>XtCreatePopupShell()</filename></para>
|
||||
</listitem><listitem><para><filename>XtCreateManagedWidget()</filename></para>
|
||||
</listitem><listitem><para><filename>XtCreateWidget()</filename></para>
|
||||
</listitem><listitem><para>次の形式のすべてのコマンド:</para>
|
||||
<programlisting>XmCreate...()</programlisting>
|
||||
</listitem><listitem><para>次の形式のほとんどのコマンド:</para>
|
||||
<programlisting>tt_...()</programlisting>
|
||||
</listitem></itemizedlist>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.Intro.div.15">
|
||||
<title>Xtイントリンシクスの初期化<indexterm><primary>Xtイントリンシクス</primary>
|
||||
<secondary>初期化</secondary></indexterm><indexterm><primary>Xtイントリンシクスの初期化</primary></indexterm></title>
|
||||
<para><command>dtksh</command>スクリプトは、Xlib、Xt、Motifまたは<command>libDt</command>コマンドを
|
||||
呼び出す前に、Xtイントリンシクスを初期化しなければなりません。
|
||||
Xtイントリンシクスの初期化は、<command><indexterm><primary>XtInitialize</primary></indexterm>XtInitialize</command>コマンドで行います。このコマンドは、
|
||||
アプリケーション・シェル・ウィジェットを返します。ウィジェットIDを返す
|
||||
<command>dtksh</command>のコマンドのすべてがそうであるように、<command>XtInitialize</command>コマンドは、最初の引き数である
|
||||
環境変数にウィジェットIDを返します。例えば、次のコマンドを実行します。</para>
|
||||
<programlisting>XtInitialize TOPLEVEL myShellName Dtksh $0 “$@”
|
||||
</programlisting>
|
||||
<para>環境変数<command>TOPLEVEL</command>にウィジェットIDが返されます。</para>
|
||||
<para><command>dtksh</command>はデフォルトの<filename>app-defaults</filename>ファイルを提供します。このファイルは、
|
||||
<command>XtInitialize</command>を呼び出しに、<command>Dtksh</command>ファイルを指定したとき、使用されます。
|
||||
<filename>app-defaults</filename>ファイルは<command>Dt</command>アプリケーションのデフォルト値の標準セットを
|
||||
含んでいます。そのため、<command>dtksh</command>アプリケーションは、他の<command>Dt</command>アプリケーションとの
|
||||
外見と調和します。</para>
|
||||
<sect2 id="DKSUG.Intro.div.16">
|
||||
<title>ウィジェットの作成<indexterm><primary>ウィジェット</primary><secondary>作成</secondary></indexterm><indexterm><primary>ウィジェットの作成</primary></indexterm></title>
|
||||
<para>ウィジェットを作成するのに使用できるコマンドを以下に示します。</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<colspec align="left" colwidth="235*">
|
||||
<colspec align="left" colwidth="221*">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><command>XtCreateWidget</command><indexterm>
|
||||
<primary>XtCreateWidget</primary></indexterm></para></entry>
|
||||
<entry align="left" valign="top"><para>管理されないウィジェットを作成します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><command>XtCreateManagedWidget</command><indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm></para></entry>
|
||||
<entry align="left" valign="top"><para>管理されるウィジェットを作成します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><command>XtCreateApplicationShell</command><indexterm>
|
||||
<primary>XtCreateApplicationShell</primary></indexterm></para></entry>
|
||||
<entry align="left" valign="top"><para>アプリケーション・シェルを作成します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><command>XtCreatePopupShell</command><indexterm>
|
||||
<primary>XtCreatePopupShell</primary></indexterm></para></entry>
|
||||
<entry align="left" valign="top"><para>ポップアップ・シェルを作成します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><command>XmCreate</command>< <emphasis>widgettypes</emphasis>></para></entry>
|
||||
<entry align="left" valign="top"><para>管理されないウィジェットを作成します。</para></entry>
|
||||
</row></tbody></tgroup></informaltable>
|
||||
<para>これらのコマンドのそれぞれに、従わなければならない特別な形式をがあります。
|
||||
例えば、トップレベル・ウィジェットの子として、管理されないプッシュ・ボタンを
|
||||
作成したいとします。<command>XtCreateWidget</command>または<command>XmCreatePushButton</command>のどちらかを使用して
|
||||
作成できます。これらのコマンドの形式は次のとおりです。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><computeroutput>XtCreateWidget</computeroutput> <emphasis>variable name widgetclass $parent [resource:value
|
||||
...]</emphasis><indexterm><primary>XtCreateWidget</primary></indexterm></para>
|
||||
</listitem><listitem><para><computeroutput>XmCreatePushButton</computeroutput> <emphasis>variable $parent name [resource:value ...]</emphasis><indexterm><primary>XmCreatePushButton</primary></indexterm></para>
|
||||
</listitem></itemizedlist>
|
||||
<para>プッシュ・ボタン・ウィジェットを作成する実際のコマンドは次のとおりです。</para>
|
||||
<programlisting>XtCreateWidget BUTTON button XmPushButton $TOPLEVEL
|
||||
XmCreatePushButton BUTTON $TOPLEVEL button</programlisting>
|
||||
<para>上記のそれぞれのコマンドは、同じ動作で管理されないプッシュ・ボタンを作成します。
|
||||
リソース値は設定されていません。プッシュ・ボタンのバック・グラウンドのカラーを
|
||||
赤、フォア・グラウンドのカラーを黒にしたいとします。リソース値のは次の方法で
|
||||
設定します。</para>
|
||||
<programlisting>XtCreateWidget BUTTON button XmPushButton $TOPLEVEL \
|
||||
background:Red \
|
||||
foreground:Black
|
||||
XmCreatePushButton BUTTON $TOPLEVEL button\
|
||||
background:Red \
|
||||
foreground:Black</programlisting>
|
||||
<para>ウィジェットを作成するすべてのC関数は、<indexterm><primary>ウィジェット</primary><secondary>操作</secondary></indexterm><indexterm><primary>操作</primary></indexterm>ウィジェットIDまたはIDを返します。対応する
|
||||
<command>dtksh</command>コマンドは、ウィジェットIDと同じ環境変数を設定します。
|
||||
これらはカテゴリ3のコマンドのため、最初の引き数はウィジェットIDを返す環境変数
|
||||
の名前です。ウィジェットIDは、<command>dtksh</command>を使用して実際のウィジェット
|
||||
・ポインタにアクセスするためのASCII文字列です。次のコマンドの両方で、新規
|
||||
フォーム・ウィジェットを作成できます。どちらの場合でも、新規フォーム・ウィジェット
|
||||
のウィジェットIDが環境変数<command>FORM</command>に返されます。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><command>XtCreateManagedWidget
|
||||
FORM name XmForm $PARENT</command><indexterm><primary>XtCreateManagedWidget</primary></indexterm></para>
|
||||
</listitem><listitem><para><command>XmCreateForm FORM $PARENT name</command><indexterm>
|
||||
<primary>XmCreateForm</primary></indexterm></para>
|
||||
</listitem></itemizedlist>
|
||||
<para>これらのコマンドのどちらかを実行後、<filename>$FORM</filename>を使用して新規
|
||||
フォーム・ウィジェットを参照できます。例えば、次のコマンドで、新規
|
||||
フォーム・ウィジェット内にラベル・ウィジェットを作成できます。</para>
|
||||
<programlisting>XmCreateLabel LABEL $FORM name\
|
||||
labelString:”Hi Mom” \
|
||||
CH_FORM \
|
||||
leftAttachment:ATTACH_FORM<indexterm><primary>XmCreateLabel</primary></indexterm></programlisting>
|
||||
<note>
|
||||
<para>NULLウィジェットを指定する必要がある場合に使用する、NULLと呼ばれる特別なウィジェットIDがあります。します。例えば、フォーム・ウィジェット
|
||||
のリソース<command>defaultButton</command>を無効にするには、次のコマンドを使用
|
||||
します。
|
||||
<command>XtSetValues</command><command> $FORM defaultButton:NULL</command></para>
|
||||
</note>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.Intro.div.17">
|
||||
<title>コールバックの使用<indexterm><primary>コールバック</primary></indexterm></title>
|
||||
<para>コールバックは、1つのイベントまたは複数のイベントの組合せが生じたときに実行する
|
||||
プッシュ・ボタン関数またはプロシージャです。例えば、コールバックは、プッシュ・
|
||||
ボタンを„押した”ときに、期待する結果をだすために使用します。
|
||||
<command>dtksh</command>シェル・スクリプトで、特定のコールバックがウィジェットに呼び出されるためのコマンドを割り当てるのは容易です。
|
||||
そのコマンドは、ブロックされたコマンドの文字列または呼び出すシェル関数の名前で
|
||||
あり、単純なものです。</para>
|
||||
<sect2 id="DKSUG.Intro.div.18">
|
||||
<title>コールバックの登録<indexterm><primary>コールバック</primary><secondary>登録</secondary></indexterm><indexterm><primary>コールバックの登録</primary>
|
||||
</indexterm></title>
|
||||
<para>アプリケーションは、関連のある状態を指定するウィジェット、その状態になった
|
||||
ときに生じるアクションを指定するウィジェットでコールバックを登録します。
|
||||
コールバックは、<command><indexterm<primary>XtAddCallback</primary></indexterm>XtAddCallback</command>を使用して登録します。
|
||||
アクションは任意の有効な<command>dtksh</command>コマンドになります。例えば次のとおりです。</para>
|
||||
<programlisting>XtAddCallback $WIDGET activateCallback “ActivateProc”
|
||||
|
||||
XtAddCallback $WIDGET activateCallback \
|
||||
“XtSetSensitive $BUTTON false”
|
||||
</programlisting>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.Intro.div.19">
|
||||
<title>コールバックにデータを渡す<indexterm><primary>コールバック</primary><secondary>コールバックにデータを渡す</secondary></indexterm></title>
|
||||
<para>コールバックには、コンテキスト情報を渡す必要があります。コンテキスト情報は、呼び出しまでの条件
|
||||
を決定します。Cプロシージャの場合、この情報は、一般的には <command>callData</command>構造体に渡さ
|
||||
れます。例えば、<command>valueChangedCallback</command>を呼び出すスケール・ウィジェットは次の構造体を<command>callData</command>に渡します。</para>
|
||||
<programlisting>typedef struct {
|
||||
int reason;
|
||||
XEvent event;
|
||||
int value;
|
||||
}XmScaleCallbackStruct;</programlisting>
|
||||
<para>Cアプリケーションのコールバックは次のようになります。</para>
|
||||
<programlisting>if (scaleCallData->reason == XmCR_VALUE_CHANGED)
|
||||
{
|
||||
eventType = scaleCallData->event->type;
|
||||
display = scaleCallData->event->xany.display;
|
||||
}</programlisting>
|
||||
|
||||
<para>同様に、コールバックが<command>dtksh</command>で呼び出されたとき、コールバック・コマンドが実行される前に次の
|
||||
環境変数が設定されます。</para>
|
||||
<programlisting>CB_WIDGET</programlisting>
|
||||
<para>これは、コールバックを呼び出しているウィジェットのウィジェットIDに設定されます。</para>
|
||||
<programlisting>CB_CALL_DATA</programlisting>
|
||||
<para>これは、コールバックに対してウィジュットによって渡される<command>callData</command>構造体のアドレスに設定さ
|
||||
れます。</para>
|
||||
<para><filename><indexterm><primary>CB_CALL_DATA</primary></indexterm>CB_CALL_DATA</filename>環境変数は構造体へのポインタのを表しており、そのフィールドへの
|
||||
アクセスには、Cのアクセスと同様の構文を使用します。
|
||||
入れ子式の環境変数が定義され、その構造体のフィールドと同様に名前(すべて大文字
|
||||
です)がつけられます。構造体の要素の内容を示すのには、ドットが使用されます。
|
||||
したがって、スケール・ウィジェットが提供する<command>callData</command>にアクセス
|
||||
する上記のCコードは、次のように翻訳されます。</para>
|
||||
<programlisting>if [ ${CB_CALL_DATA.REASON} = “CR_VALUE_CHANGED” ]; then
|
||||
eventType=${CB_CALL_DATA.EVENT.TYPE}
|
||||
display=${CB_CALL_DATA.EVENT.XANY.DISPLAY}
|
||||
fi</programlisting>
|
||||
<para>同じことが、<command>callData</command>構造体内のイベント構造体にもいえます。</para>
|
||||
<para>ほとんどのコールバック構造体に対して、シェルスクリプトは、特定のコールバック
|
||||
構造体に定義されている任意のフィールドを、先に説明した技法を使用して参照する
|
||||
ことができます。ほとんどの場合、シェル・スクリプトは、これらの構造体内のフィールド
|
||||
の値を変更できません。この例外は、<command>XmTextVerifyCallbackStruct</command>です。これは、テキスト
|
||||
ウィジェットの<command>losingFocusCallback</command>、<command>modifyVerifyCallback</command>、および<command>motionVerifyCallback</command>
|
||||
で有効です。
|
||||
<command>dtksh</command>は、Motifによってサポートされている範囲で、この構造体内のフィールドを変更を
|
||||
サポートしています。コールバック構造体の次のフィールドは、変更可能です。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>CB_CALL_DATA.DOIT</filename></para>
|
||||
</listitem><listitem><para><filename>CB_CALL_DATA.STARTPOS</filename></para>
|
||||
</listitem><listitem><para><filename>CB_CALL_DATA.TEXT.PTR</filename></para>
|
||||
</listitem><listitem><para><filename>CB_CALL_DATA.TEXT.LENGTH</filename></para>
|
||||
</listitem><listitem><para><filename>CB_CALL_DATA.TEXT.FORMAT</filename></para>
|
||||
</listitem></itemizedlist>
|
||||
<para>上記のフィールドは次のように変更できます。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>CB_CALL_DATA.DOIT=”false”</filename></para>
|
||||
</listitem><listitem><para><filename>CB_CALL_DATA.TEXT.PTR=”*”</filename></para>
|
||||
</listitem><listitem><para><filename>CB_CALL_DATA.TEXT.LENGTH=1</filename></para>
|
||||
</listitem></itemizedlist>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub Caret>
|
||||
<?Pub *0000033871>
|
||||
123
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch02.sgm
Normal file
123
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch02.sgm
Normal file
@@ -0,0 +1,123 @@
|
||||
<!-- $XConsortium: ch02.sgm /main/7 1996/09/08 19:45:49 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<chapter id="DKSUG.scr1.div.1">
|
||||
<title>スクリプト例<indexterm><primary>スクリプト</primary><secondary>スクリプト例</secondary></indexterm><indexterm><primary>スクリプト例</primary></indexterm></title>
|
||||
<para>この章は、1章で学んだ<command>dtksh</command>の使用方法を説明します。
|
||||
ここに記述されている2つの簡単なスクリプトは、独自のスクリプトを記述しはじめる際に、
|
||||
よい参考になります。</para>
|
||||
<sect1 id="DKSUG.scr1.div.2">
|
||||
<title>スクリプトの記述<indexterm><primary>スクリプト</primary><secondary>記述</secondary></indexterm></title>
|
||||
<para>このスクリプトは、プッシュ・ボタン・ウィジェットを置いたブリテン・ボード・ウィジェット
|
||||
を作成しています。スクリプトは、コールバックを含まない簡単なものです。2つめの
|
||||
スクリプトにはコールバックが含まれています。</para>
|
||||
<para>1つめのスクリプトは次のとおりです。</para>
|
||||
<programlisting>#!/usr/dt/bin/dtksh
|
||||
XtInitialize TOPLEVEL dttest1 Dtksh $0<indexterm><primary>XtInitialize</primary>
|
||||
</indexterm>
|
||||
XtSetValues $TOPLEVEL title:“dttest1”<indexterm><primary>XtSetValues</primary></indexterm>
|
||||
XtCreateManagedWidget BBOARD bboard XmBulletinBoard $TOPLEVEL \
|
||||
resizePolicy:RESIZE_NONE height:150 width:250\
|
||||
background:SkyBlue<indexterm><primary>XtCreateManagedWidget</primary></indexterm>
|
||||
XtCreateManagedWidget BUTTON pushbutton XmPushButton $BBOARD \<indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm>
|
||||
background:goldenrod \
|
||||
foreground:MidnightBlue \
|
||||
labelString:”Push Here” \
|
||||
height:30 width:100 x:75 y:60 shadowThickness:3
|
||||
XtRealizeWidget $TOPLEVEL<indexterm><primary>XtRealizeWidget</primary></indexterm>XtMainLoop<indexterm>
|
||||
<primary>XtMainLoop</primary></indexterm></programlisting>
|
||||
<para>図2-1に1つめのスクリプトが生成するウィンドウを示します。</para>
|
||||
<figure>
|
||||
<title>dttestスクリプトのウィンドウ</title>
|
||||
<graphic id="DKSUG.scr1.grph.1" entityref="DKSUG.scr1.fig.1"></graphic>
|
||||
</figure>
|
||||
<para>スクリプトの1行めは次のとおりです。</para>
|
||||
<programlisting>#!/usr/dt/bin/dtksh</programlisting>
|
||||
<para>これは、標準的なシェルではなく、<filename>/usr/dt/bin/dtksh</filename>を使用してスクリプトを実行することを、
|
||||
オペレーティング・システムに指示します。</para>
|
||||
<para>次の行はXtイントリンシクスを初期化しています。<indexterm><primary>初期化</primary></indexterm></para>
|
||||
<para>XtInitialize TOPLEVEL dttest1 Dtksh $0</para>
|
||||
<para><indexterm><primary>トップレベル・ウィジェット</primary></indexterm><indexterm><primary>ウィジェット</primary><secondary>トップレベル・ウィジェット</secondary></indexterm>トップレベル・ウィジェットの名前は環境変数<filename>$TOPLEVEL</filename>に保存され、シェル・ウィジェット
|
||||
の名前は<filename>dttest1</filename>、アプリケーション・クラス名は<filename>Dtksh</filename>、そしてアプリケーション名は
|
||||
<command>dtksh</command>変数<filename>$0</filename>であることを表しています。</para>
|
||||
<para>次の行は、タイトル・リソースにスクリプト名を設定しています。</para>
|
||||
<programlisting>XtSetValues $TOPLEVEL title:”dttest1”</programlisting>
|
||||
<para>リソース名(タイトル)の終りにあるコロンとその値の間にスペースは入りません。
|
||||
スペースが入っていると、エラー・メッセージが表示されます。</para>
|
||||
<para>次の4行で、<indexterm><primary>ブリテン・ボード</primary></indexterm><indexterm><primary>ウィジェット</primary><secondary>ブリテン・ボード</secondary></indexterm>ブリテン・ボード・ウィジェットを作成し、いくつかのリソースを設定します。</para>
|
||||
<programlisting>XtCreateManagedWidget BBOARD bboard XmBbulletinBoard $TOPLEVEL \
|
||||
resizePolicy:RESIZE_NONE \
|
||||
background:SkyBlue\
|
||||
height:150 width:250</programlisting>
|
||||
<para>ブリテン・ボード・ウィジェットのIDは環境変数<filename>$BBOARD</filename>に保存されます。
|
||||
ウィジェットの名前は<command>bboard</command>です。この名前は、Xtイントリンシクスで、外部の
|
||||
リソース・ファイルでリソースの値を設定する際に使用します。ウィジェット・クラスは、
|
||||
<command>XmBulletinBoard</command>です。ブリテン・ボードの親ウィジェットは、環境変数<filename>$TOPLEVEL</filename>
|
||||
に登録されているウィジェットIDです。
|
||||
これは、最初の行の初期化コマンドで生成したトップレベル・ウィジェットです。行の
|
||||
終りにある\(バックスラッシュ)は、このコマンドが次の行に続いていることを、<command>dtksh</command>に指示しています。</para>
|
||||
<para>次の6行はブリテン・ボード・ウィジェットの子として<indexterm><primary>プッシュ・ボタン</primary></indexterm><indexterm><primary>ウィジェット</primary><secondary>ブリテン・ボード</secondary>プッシュ・ボタン・ウィジェット
|
||||
を作成し、いくつかのプッシュ・ボタンのリソースを設定します。</para>
|
||||
<programlisting>XtCreateManagedWidget BUTTON pushbutton XmPushButton $BBOARD \
|
||||
background:goldenrod \
|
||||
foreground:MidnightBlue \
|
||||
labelString:”Push Here”\
|
||||
height:30 width:100 x:75 y:60\
|
||||
shadowThickness:3</programlisting>
|
||||
<para>これは、変数、名前、クラス、親が異なっていることを除いて、基本的には、ブリテン
|
||||
・ボードの作成に使用したプロシージャと同じです。</para>
|
||||
<para>次の行で、トップレベル・ウィジェットとそのすべての子を実現します。</para>
|
||||
<programlisting>XtRealizeWidget $TOPLEVEL<indexterm><primary>XtrealizeWidget</primary></indexterm></programlisting>
|
||||
<para>最後に、<indexterm><primary>XtMainLoop</primary></indexterm><command>XtMainLoop</command> コマンドが、ウィジェットのためのイベントのループ処理を
|
||||
開始します。 </para>
|
||||
<programlisting>XtMainLoop</programlisting>
|
||||
<para>このスクリプトで、ウィンドウがディスプレイに表示されます。ウィンドウ・マネージャで
|
||||
<command>[閉じる]</command>を選択するか、またはスクリプトを実行した端末ウィンドウで[CTRL]+[C]キーを
|
||||
押して、このスクリプトを終了するまで、ウィンドウは表示されたままの状態になります。</para>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.scr1.div.3">
|
||||
<title>コールバックの追加<indexterm><primary>コールバック</primary></indexterm></title>
|
||||
<para>プッシュ・ボタンが押されたときに、端末ウィンドウにメッセージを表示し、スクリプト
|
||||
が終了するプッシュ・ボタンの機能を提供するには、コールバックを追加する必要が
|
||||
あります。そして、このコールバックの存在をプッシュ・ボタンに指示する必要もあり
|
||||
ます。新規コードを追加したスクリプトは次のとおりです。</para>
|
||||
<programlisting>#!/usr/dt/bin/dtksh
|
||||
|
||||
activateCB() {
|
||||
echo “Pushbutton activated; normal termination.”
|
||||
exit 0
|
||||
}
|
||||
|
||||
XtInitialize TOPLEVEL dttest2 Dtksh $0
|
||||
XtSetValues $TOPLEVEL title:”dttest2”
|
||||
XtCreateManagedWidget BBOARD bboard XmBulletinBoard $TOPLEVEL \
|
||||
resizePolicy:RESIZE_NONE \
|
||||
background:SkyBlue \
|
||||
height:150 width:250
|
||||
XtCreateManagedWidget BUTTON pushbutton XmPushButton $BBOARD \
|
||||
background:goldenrod \
|
||||
foreground:MidnightBlue \
|
||||
labelString:”Push Here”\
|
||||
height:30 width:100 x:75 y:60 shadowThickness:3
|
||||
|
||||
XtAddCallback $BUTTON activateCallback activateCB
|
||||
XtRealizeWidget $TOPLEVEL
|
||||
XtMainLoop</programlisting>
|
||||
<para>コールバックは関数<filename>activateCB()</filename>です。通常、プッシュ・ボタン
|
||||
を作成した後、プッシュ・ボタンに対するコールバックを追加します。</para>
|
||||
<programlisting>XtAddCallback $BUTTON activateCallback activateCB</programlisting>
|
||||
<para>プッシュ・ボタンはコールバックを認識します。プッシュ・ボタンがクリックされたとき、
|
||||
<filename>activateCB()</filename>関数が実行され、„<command>Pushbutton activated; normal termination.</command>”
|
||||
というメッセージが、スクリプトを実行した端末ウィンドウに表示されます。スクリプトは、
|
||||
関数<command>exit 0</command>を呼び出すことによって、終了します。</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub Caret>
|
||||
<?Pub *0000009074>
|
||||
496
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch03.sgm
Normal file
496
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch03.sgm
Normal file
@@ -0,0 +1,496 @@
|
||||
<!-- $XConsortium: ch03.sgm /main/8 1996/09/08 19:46:03 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<chapter id="DKSUG.adv.div.1">
|
||||
<title id="DKSUG.adv.mkr.1">上級トピック</title>
|
||||
<para>これまでに、<command>dtksh</command>の基本的な知識について説明しました。この章は、より上級の
|
||||
トピックを説明します。</para>
|
||||
<sect1 id="DKSUG.adv.div.2">
|
||||
<title>コンテキスト変数の使用方法</title>
|
||||
<para><command>dtksh</command>は、アプリケーションの外見に対するコンテキストを提供する多くの変数が
|
||||
あります。</para>
|
||||
<sect2 id="DKSUG.adv.div.3">
|
||||
<title>イベント・ハンドラ・コンテキスト変数<indexterm><primary>コンテキスト変数</primary><secondary>イベント・ハンドラ</secondary></indexterm><indexterm><primary>イベント・ハンドラ</primary></indexterm></title>
|
||||
<para>アプリケーションは、指定したイベントの1つが発生したときに生じるアクションに対する
|
||||
ウィジェットのイベント・ハンドラを登録しています。アクションは、任意の<command>dtksh</command>
|
||||
コマンド行で指定できます。例えば、次のとおりです。</para>
|
||||
<programlisting>XtAddEventHandler $W “Button2MotionMask“ false “ActivateProc“
|
||||
XtAddEventHandler $W “ButtonPressMask|ButtonReleaseMask“ \
|
||||
false “echo action“</programlisting>
|
||||
<para>イベント・ハンドラに対するコンテキストを提供するために、2つの環境変数が定義され
|
||||
ています。</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<?PubTbl tgroup dispwid="5.64in">
|
||||
<colspec align="left" colwidth="100*">
|
||||
<colspec align="left" colwidth="365*">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>EH_WIDGET</para></entry>
|
||||
<entry align="left" valign="top"><para>イベント・ハンドラを登録する
|
||||
ウィジェットのIDを設定します。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>EH_EVENT</para></entry>
|
||||
<entry align="left" valign="top"><para>イベント・ハンドラを起動する<command>XEvent</command>の
|
||||
アドレスを設定します。</para></entry></row>
|
||||
</tbody></tgroup></informaltable>
|
||||
<para><command>XEvent</command>構造体のフィールドへのアクセスを次の例で示します。</para>
|
||||
<programlisting>if [ ${EH_EVENT.TYPE} = “ButtonPress“ ]; then
|
||||
echo “X = “${EH_EVENT.XBUTTON.X}
|
||||
echo “Y = “${EH_EVENT.XBUTTON.Y}
|
||||
elif [ ${EH_EVENT.TYPE} = “KeyPress“ ]; then
|
||||
echo “X = “${EH_EVENT.XKEY.X}
|
||||
echo “Y = “${EH_EVENT.XKEY.Y}
|
||||
fi</programlisting>
|
||||
</sect2>
|
||||
<sect2 id="dksug.adv.div.4">
|
||||
<title>トランスレーション・コンテキスト変数<indexterm><primary>コンテキスト変数</primary>
|
||||
<secondary>トランスレーション</secondary></indexterm><indexterm><primary>トランスレーション</primary></indexterm></title>
|
||||
<para>Xtイントリンシクスは、ウィジェットに登録するイベントのトランスレーションを提供
|
||||
します。イベントのトランスレーションのコンテキストは、イベント・ハンドラに
|
||||
コンテキストを提供するのと同じ方法で提供されます。トランスレーション・コマンドで定義されている2
|
||||
つの変数は、次のとおりです。</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<?PubTbl tgroup dispwid="6.04in">
|
||||
<colspec align="left" colwidth="196*">
|
||||
<colspec align="left" colwidth="302*">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>TRANSLATION_WIDGET</para></entry>
|
||||
<entry align="left" valign="top"><para>トランスレーションが登録されているウィジェットの
|
||||
ウィジェット操作を設定します。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>TRANSLATION_EVENT</para></entry>
|
||||
<entry align="left" valign="top"><para>トランスレーションを起動する<command>XEvent</command>のアドレスを
|
||||
設定します。</para></entry></row></tbody>
|
||||
</tgroup></informaltable>
|
||||
<para>次のようなドット表記で、イベントのフィールドにアクセスできます。</para>
|
||||
<programlisting>echo “Event type = “${TRANSLATION_EVENT.TYPE}
|
||||
echo “Display = “${TRANSLATION_EVENT.XANY.DISPLAY}</programlisting>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.adv.div.5">
|
||||
<title>ワークスペース・コールバック・コンテキスト変数<indexterm><primary>コンテキスト変数</primary><secondary>ワークスペース・コールバック</secondary></indexterm><indexterm>
|
||||
<primary>ワークスペース・コールバック</primary></indexterm><indexterm><primary>コールバック</primary><secondary>ワークスペース</secondary></indexterm></title>
|
||||
<para>アプリケーションは、ユーザが新規ワークスペースに変更したとき、常に呼び出される
|
||||
コールバック関数を登録することができます。コールバックが呼び出されたとき、2つの
|
||||
特別な環境変数を設定します。この環境変数は、シェル・コールバックのコードでアクセス
|
||||
できます。</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<?PubTbl tgroup dispwid="6.00in">
|
||||
<colspec align="left" colwidth="144*">
|
||||
<colspec align="left" colwidth="351*">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>CB_WIDGET</para></entry>
|
||||
<entry align="left" valign="top"><para>コールバックを呼び出すウィジェットのIDを設定します。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>CB_CALL_DATA</para></entry>
|
||||
<entry align="left" valign="top"><para>新規ワークスペースを一意に識別するXアトムを設定します。
|
||||
これは、<command>XmGetAtomName</command>コマンドを使用して
|
||||
文字表現に変換できます。</para></entry></row></tbody>
|
||||
</tgroup></informaltable>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.adv.div.6">
|
||||
<title>入力コンテキスト変数<indexterm><primary>コンテキスト変数</primary>
|
||||
<secondary>入力</secondary></indexterm><indexterm><primary>入力コンテキスト変数</primary></indexterm></title>
|
||||
<para>Xtイントリンシクスは、<command>XtAddInput</command>機能を提供おり、
|
||||
アプリケーションは、特定のファイル記述子から使用可能な任意なデータのアクセス手段を
|
||||
登録できます。C言語でプログラミングしたとき、アプリケーションはハンドラ関数を
|
||||
提供します。これは入力が可能なときに呼び出される関数です。
|
||||
入力ソースからのデータの読み込み、エスケープ文字や継続行の操作は、ハンドラが行います。</para>
|
||||
<para><command><indexterm><primary>XtAddInput</primary></indexterm>dtksh</command>も、<command>XtAddInput</command>機能をサポートしていますが、それ以上の処理を行い、
|
||||
シェル・プログラマから容易に使用できます。デフォルトでは、シェル・スクリプトが
|
||||
ファイル記述子のアクセス手段を登録したとき、<command>dtksh</command>は、テキストの完全行を受け取った場合にのみ、<command>dtksh</command>はシェル・スクリプトの
|
||||
入力ハンドラを呼び出します。テキストの完全行は、エスケープされていない改行文字
|
||||
またはファイルの終りのどちらかで終了した行と定義されます。入力ハンドラは、使用
|
||||
可能なデータがなく、ファイルの終りに達した場合にも呼び出されます。ハンドラは、
|
||||
入力ソースを削除し、ファイル記述子を閉じるのに、<command><indexterm><primary>XtRemoveInput</primary></indexterm>XtRemoveInput</command>を使用でき
|
||||
ます。このデフォルト動作の利点は、入力ハンドラがエスケープ処理または継続行の操作
|
||||
を考慮する必要がないことです。欠点は、すべての入力が行単位で、バイナリ情報を
|
||||
含んでいないことを想定している点です。</para>
|
||||
<para><command>dtksh</command>は、入力ソースがバイナリ情報を含んでいる場合、または入力ハンドラが入力
|
||||
ソースから直接データを読み込みたい場合、„raw”<indexterm>
|
||||
<primary>入力モード</primary></indexterm>入力モードをしています。
|
||||
rawモードでは、<command>dtksh</command>は入力ソースからデータを読み込めません。
|
||||
<command>dtksh</command>は、 入力ソースに入力が可能なことを知らせるときに、シェル・スクリプトの
|
||||
入力ハンドラを呼び出します。入力データを読み込んだり、バッファの要求とエスケープ
|
||||
処理を行ったり、ファイルの終りになったかを検出したりするのは、ハンドラが行います。
|
||||
(これにより、入力ソースを削除、ファイル拡張子を閉じることが
|
||||
できます)。このモードは、まれにしか<command>dtksh</command>スクリプトで必要となる
|
||||
ことはありません。</para>
|
||||
<para>入力ハンドラが、デフォルト・モードまたはrawモードのどちらで動くように構成されているで、
|
||||
<command>dtksh</command>はシェル・スクリプトの入力ハンドラを呼び出す前に、いくつかの
|
||||
環境変数を設定します。これらの環境変数は、入力ハンドラに、入力データの操作に必要な
|
||||
もののすべてを提供します。</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<?PubTbl tgroup dispwid="6.09in">
|
||||
<colspec align="left" colwidth="140*">
|
||||
<colspec align="left" colwidth="362*">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>INPUT_LINE</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>デフォルト・モードのとき、この変数は入力ソースから使用可能な次の入力の完全行
|
||||
になります。<filename>INPUT_EOF</filename>がtrueのときは、このバッファにデータがありません。rawモードのときはこの変数は常に空文字になります。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>INPUT_EOF</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>デフォルト・モードのとき、この変数は、<filename>INPUT_LINE</filename>にデータが含まれて
|
||||
いるときはfalseが設定され、ファイルの終りに達したときにtrueが設定されます。
|
||||
ファイルの終りに達したときに、シェル・スクリプトの入力ハンドラは入力ソースを
|
||||
登録解除し、ファイル記述子を閉じます。rawモードで作動すると、この変数は常に
|
||||
falseが設定されます。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>INPUT_SOURCE</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>これは、入力が可能なファイル記述子を示します。rawモードで作動すると、
|
||||
このファイル記述子は、保留になっている入力を得るのに使用されます。
|
||||
ファイル記述子は、必要がなくなったときに、入力ソースを閉じるのにも使用
|
||||
されます。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>INPUT_ID</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>これは、入力ソースが登録されているときに、<command>XtAddInput</command>が
|
||||
返すIDを示します。この情報は、<command>XtRemoveInput</command>で入力ソースを削除する
|
||||
のに必要です。</para></entry></row></tbody></tgroup></informaltable>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.7">
|
||||
<title>イベント・サブフィールドへのアクセス<indexterm><primary>イベント・サブフィールド</primary>
|
||||
</indexterm></title>
|
||||
<para><command>XEvent</command>構造体は、イベントの型に基づいて、異なる構成が多数あります。<command>dtksh</command>は、もっとも頻繁に
|
||||
使用される<command>XEvents</command>へのアクセスのみ提供しています。他の標準的
|
||||
な<command>XEvents</command>には、イベント型<command>XANY</command>を使用してアクセスします。
|
||||
イベント型<command>XANY</command>は、<command>XANY</command>イベント構造体で定義されている次のサブフィールドを含んでいます。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>${TRANSLATION_EVENT.XANY.TYPE}</filename></para>
|
||||
</listitem><listitem><para><filename>${TRANSLATION_EVENT.XANY.SERIAL}</filename></para>
|
||||
</listitem><listitem><para><filename>${TRANSLATION_EVENT.XANY.SEND_EVENT}</filename></para>
|
||||
</listitem><listitem><para><command>${TRANSLATION_EVENT.XANY.DISPLAY}</command></para>
|
||||
</listitem><listitem><para><filename>${TRANSLATION_EVENT.XANY.WINDOW}</filename></para>
|
||||
</listitem></itemizedlist>
|
||||
<para><command>dtksh</command>は、次のイベント型のすべてのイベント・フィールドに対するクセスを、すべて
|
||||
サポートしています。 </para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><command>XANY</command></para>
|
||||
</listitem><listitem><para><command>XBUTTON</command></para>
|
||||
</listitem><listitem><para><command>XEXPOSE</command></para>
|
||||
</listitem><listitem><para><command>XNOEXPOSE</command></para>
|
||||
</listitem><listitem><para><command>XGRAPHICSEXPOSE</command></para>
|
||||
</listitem><listitem><para><command>XKEY</command></para>
|
||||
</listitem><listitem><para><command>XMOTION</command></para>
|
||||
</listitem></itemizedlist>
|
||||
<para>次の例は、前述のイベント型のサブフィールドにどのようにしてアクセスするかを示しています。</para>
|
||||
<programlisting>${TRANSLATION_EVENT.XBUTTON.X}
|
||||
$(CB_CALL_DATA.EVENT.XKEY.STATE}
|
||||
${EH_EVENT.XGRAPHICSEXPOSE.WIDTH}</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.8">
|
||||
<title>ウィンドウ・マネージャのクローズ通知の応答</title>
|
||||
<para>ユーザがアプリケーションに対して、ウィンドウ・マネージャ・メニューから<indexterm><primary>ウィンドウ・マネージャのクローズ通知</primary></indexterm>[閉じる]を
|
||||
選択したとき、アプリケーションは、クローズ通知を“受け取る”準備ができて
|
||||
いないと終了します。アプリケーションが通知を受け取らないと、アプリケーションによって
|
||||
管理している複数のウィンドウがすべて消え、アプリケーションのデータは望ましく
|
||||
ない状態のまま、残るかもしれません。これを避けるために、<command>dtksh</command>は、
|
||||
クローズ通知の受け取りおよび操作に備えています。アプリケーションは次のことを
|
||||
行う必要があります。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para>クローズ通知を操作するプロシージャを定義します。</para>
|
||||
</listitem><listitem><para>[閉じる]が選択されたときに通知を要求します。</para>
|
||||
</listitem><listitem><para>アプリケーションがシャット・ダウンされないように応答を無効にします</para>
|
||||
</listitem></itemizedlist>
|
||||
<para>次のコードは、この処理について説明しています。</para>
|
||||
<programlisting># This is the `callback' invoked when the user selects
|
||||
# the `Close' menu item
|
||||
WMCallback()
|
||||
{
|
||||
echo “User has selected the Close menu item“
|
||||
}
|
||||
# Create the toplevel application shell
|
||||
XtInitialize TOPLEVEL test Dtksh $0 “$@“
|
||||
XtDisplay DISPLAY $TOPLEVEL
|
||||
|
||||
# Request notification when the user selects the `Close'
|
||||
# menu item
|
||||
XmInternAtom DELETE_ATOM $DISPLAY “WM_DELETE_WINDOW“ false
|
||||
XmAddWMProtocolCallback $TOPLEVEL $DELETE_ATOM “WMCallback“
|
||||
|
||||
# Ask Motif to not automatically close down your
|
||||
# application window
|
||||
XtSetValues $TOPLEVEL deleteResponse:DO_NOTHING</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.9">
|
||||
<title>セッション・マネージャの保存状態通知の応答<indexterm><primary>セッション・マネージャの保存状態通知の応答</primary></indexterm></title>
|
||||
<para>セッション・マネージャは、アプリケーションに、ユーザが現在のセッションを終了する
|
||||
ときの状態を保存させます。これにより、ユーザが再起動したときに、アプリケーションは、
|
||||
前に終了したときと同じ状態に戻ることができます。<command>dtksh</command>では、
|
||||
クローズ通知を操作するのと同様の方法でハンドラを設定します。ハンドラを設定しない
|
||||
と、新規セッションで、アプリケーションを手動で再起動しなくてはなりません。
|
||||
また、ハンドラを設定しないと、アプリケーションは状態を保持しません。</para>
|
||||
<para>ハンドラを設定して、現在の状態を保存するには、アプリケーションは、次のことを行います。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para>セッションの終りで状態を保存し、起動時にそれを復元する関数を定義します。</para>
|
||||
</listitem><listitem><para>セッション・マネージャの通知の配信対象を登録します。</para>
|
||||
</listitem><listitem><para>状態を保存する関数を登録します。</para>
|
||||
</listitem><listitem><para>起動時に、保存した状態を復元するかどうかを決定します。</para>
|
||||
</listitem></itemizedlist>
|
||||
<para>次のコードはこの処理について説明しています。</para>
|
||||
<programlisting>#! /usr/dt/bin/dtksh
|
||||
# Function invoked when the session is being ended by the user
|
||||
SessionCallback()
|
||||
{
|
||||
# Get the name of the file into which we should save our
|
||||
# session information
|
||||
if DtSessionSavePath $TOPLEVEL PATH SAVEFILE; then
|
||||
exec 9>$PATH
|
||||
|
||||
# Save off whether we are currently in an iconified state
|
||||
if DtShellIsIconified $TOPLEVEL; then
|
||||
print -u9 `Iconified'
|
||||
else
|
||||
print -u9 `Deiconified'
|
||||
fi
|
||||
|
||||
# Save off the list of workspaces we currently reside in
|
||||
if DtWsmGetWorkspacesOccupied $(XtDisplay “-“ $TOPLEVEL) \
|
||||
$(XtWindow “-“ $TOPLEVEL) \
|
||||
CURRENT_WS_LIST;
|
||||
then
|
||||
# Map the comma-separated list of atoms into
|
||||
# their string representation
|
||||
oldIFS=$IFS
|
||||
IFS=“,“
|
||||
for item in $CURRENT_WS_LIST;
|
||||
do
|
||||
XmGetAtomName NAME $(XtDisplay “-“ $TOPLEVEL) \
|
||||
$item
|
||||
print -u9 $NAME
|
||||
done
|
||||
IFS=$oldIFS
|
||||
fi
|
||||
|
||||
exec 9<&-
|
||||
|
||||
# Let the session manager know how to invoke us when
|
||||
# the session is restored
|
||||
DtSetStartupCommand $TOPLEVEL \
|
||||
“/usr/dt/contrib/dtksh/SessionTest $SAVEFILE“
|
||||
else
|
||||
echo “DtSessionSavePath FAILED!!“
|
||||
exit -3
|
||||
fi
|
||||
}
|
||||
|
||||
# Function invoked during a restore session; restores the
|
||||
# application to its previous state
|
||||
RestoreSession()
|
||||
{
|
||||
# Retrieve the path where our session file resides
|
||||
if DtSessionRestorePath $TOPLEVEL PATH $1; then
|
||||
exec 9<$PATH
|
||||
read -u9 ICONIFY
|
||||
|
||||
# Extract and restore our iconified state
|
||||
case $ICONIFY in
|
||||
Iconified) DtSetIconifyHint $TOPLEVEL True;;
|
||||
*) DtSetIconifyHint $TOPLEVEL False;
|
||||
esac
|
||||
|
||||
# Extract the list of workspaces we belong in, convert
|
||||
# them to atoms, and ask the Workspace Manager to relocate
|
||||
# us to those workspaces
|
||||
WS_LIST=““
|
||||
while read -u9 NAME
|
||||
do
|
||||
XmInternAtom ATOM $(XtDisplay “-“ $TOPLEVEL) \
|
||||
$NAME False
|
||||
if [ ${#WS_LIST} -gt 0 ]; then
|
||||
WS_LIST=$WS_LIST,$ATOM
|
||||
else
|
||||
WS_LIST=$ATOM
|
||||
fi
|
||||
done
|
||||
|
||||
DtWsmSetWorkspacesOccupied $(XtDisplay “-“ $TOPLEVEL) \
|
||||
$(XtWindow “-“ $TOPLEVEL) $WS_LIST
|
||||
|
||||
exec 9<&-
|
||||
else
|
||||
echo “DtSessionRestorePath FAILED!!“
|
||||
exit -3
|
||||
fi
|
||||
}
|
||||
################## Create the Main UI #######################
|
||||
XtInitialize TOPLEVEL wmProtTest Dtksh $0 “$@“
|
||||
XtCreateManagedWidget DA da XmDrawingArea $TOPLEVEL \
|
||||
height:200 width:200
|
||||
XmInternAtom SAVE_SESSION_ATOM $(XtDisplay “-“ $TOPLEVEL) \
|
||||
“WM_SAVE_YOURSELF“ False
|
||||
|
||||
# If a command-line argument was supplied, then treat it as the
|
||||
# name of the session file
|
||||
if (( $# > 0))
|
||||
then
|
||||
# Restore to the state specified in the passed-in session file
|
||||
XtSetValues $TOPLEVEL mappedWhenManaged:False
|
||||
XtRealizeWidget $TOPLEVEL
|
||||
XSync $(XtDisplay “-“ $TOPLEVEL) False
|
||||
RestoreSession $1
|
||||
XtSetValues $TOPLEVEL mappedWhenManaged:True
|
||||
XtPopup $TOPLEVEL GrabNone
|
||||
else
|
||||
# This is not a session restore, so come up in the default state
|
||||
XtRealizeWidget $TOPLEVEL
|
||||
XSync $(XtDisplay “-“ $TOPLEVEL) False
|
||||
fi
|
||||
|
||||
# Register the fact that we are interested in participating in
|
||||
# session management
|
||||
XmAddWMProtocols $TOPLEVEL $SAVE_SESSION_ATOM
|
||||
XmAddWMProtocolCallback $TOPLEVEL $SAVE_SESSION_ATOM \
|
||||
SessionCallback
|
||||
|
||||
XtMainLoop</programlisting>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.10">
|
||||
<title>ワークスペース・マネージャとの協調<indexterm><primary>ワークスペースの管理</primary></indexterm></title>
|
||||
<para><command>dtksh</command>は、Dtライブラリの主なワークスペース・マネージャ関数(アプリケーションに
|
||||
関連のあるワークスペースのセットの問い合わせおよび設定を行う関数、すべての
|
||||
ワークスペースのリストの問い合わせを行う関数、現在のワークスペースの問い合わせ
|
||||
および設定を行う関数、およびユーザが別のワークスペースに変更するときにアプリ
|
||||
ケーションに通知を要求する関数など)のすべてにアクセスできます。</para>
|
||||
<para>ユーザから見て、ワークスペースは名前のセットで識別されます。しかし、ワーク
|
||||
スペース・マネージャから見ると、ワークスペースはXアトムで識別されます。
|
||||
シェル・スクリプトが、ワークスペース識別子のリストを要求すると、Xアトムの文字列
|
||||
が返されます。複数のXアトムが存在するときは、リストはカンマで区切られます。
|
||||
ワークスペース・マネージャは、シェル・ スクリプトにワークスペース識別子を戻した
|
||||
ときと同じ形式を、シェル・スクリプトが使用することを期待しています。指定した
|
||||
セッションの間、Xアトムは変わらないため、シェル・スクリプトによるXアトムの処理
|
||||
は安全です。
|
||||
しかし、前節で示したセッション・マネージャのシェル・スクリプト例のように、
|
||||
シェル・スクリプトがワークスペース識別子の保存および復元を行う場合、識別子は、
|
||||
保存する前に、Xアトム表現から文字列に変換する必要があります。そして、セッション
|
||||
を復元するとき、ワークスペースマネージャに情報を渡す前にXアトムに、その名前を
|
||||
マップしなおす必要があります。Xアトムと文字列間のマッピング、および文字列と
|
||||
Xアトム間のマッピングには、次の2つのコマンドを使用します。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><command>XmInternAtom ATOM $DISPLAY
|
||||
$WORKSPACE_NAME false</command></para>
|
||||
</listitem><listitem><para><command>XmGetAtomName NAME $DISPLAY $ATOM</command></para>
|
||||
</listitem></itemizedlist>
|
||||
<para>ワークスペース管理を行う特定の<command>dtksh</command>コマンドについては、付録Aの
|
||||
「組み込みlibDtセッション管理コマンド」で説明しています。</para>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.11">
|
||||
<title>ローカライズされたシェル・スクリプトの作成<indexterm><primary>ローカライズされたスクリプト</primary></indexterm><indexterm><primary>スクリプト</primary><secondary>ローカライズされたスクリプト</secondary></indexterm></title>
|
||||
<para><command>dtksh</command>スクリプトは、 Cアプリケーションと同様の処理で、国際化対応および
|
||||
ローカライズを行います。ユーザに表示されるすべての文字列は、スクリプトで識別
|
||||
されます。ポストプロセッサはスクリプトから文字列を取り出し、カタログを作成し
|
||||
ます。カタログは、希望のローカルに翻訳されます。スクリプトが実行されるとき、
|
||||
現在のローカルは、表示される文字列を探すためのメッセージ・カタログを決定します。
|
||||
文字列が表示されるとき、文字列は、セット内のメッセージ・セットIDとメッセージ
|
||||
番号によって識別されます。これらの値はユーザに示されるテキストを決定します。
|
||||
次のコードは、その処理についてを説明しています。</para>
|
||||
<programlisting># Attempt to open our message catalog
|
||||
catopen MSG_CAT_ID “myCatalog.cat“
|
||||
|
||||
# The localized button label is in set 1, and is message # 2
|
||||
XtCreatePushButton OK $PARENT ok \
|
||||
labelString:$(catgets $MSG_CAT_ID 1 2 “OK“)
|
||||
|
||||
# The localized button label is in set 1, and is message #3
|
||||
XtCreatePushButton CANCEL $PARENT cancel \
|
||||
labelString:$(catgets $MSG_CAT_ID 1 3 “Cancel“)
|
||||
|
||||
# Close the message catalog, when no longer needed
|
||||
catclose $MSG_CAT_ID</programlisting>
|
||||
<para><command>catopen</command>によって返されるファイル記述子は、kshellの<command>exec</command>コマンドではなく
|
||||
<command>catclose</command>を使用して閉じなければなりません。</para>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.12">
|
||||
<title>dtkshを使用したX描画関数へのアクセス<indexterm><primary>drawing
|
||||
functions</primary></indexterm></title>
|
||||
<para><command>dtksh</command>コマンドには、線、点、セグメント、区画、弧、および多角形を描く標準的な
|
||||
Xlib描画関数が含まれています。標準的なCプログラミングの環境において、これらの
|
||||
関数は、描画データとしてだけではなく、引き数としてグラフィック・コンテキスト
|
||||
(GC)を見なしています。<command>dtksh</command>の描画関数では、GCオプションの
|
||||
集合は、コマンドに対するパラメータ・リストで指定されます。</para>
|
||||
<para>デフォルトでは、描画コマンドは特定のコマンドに使用された後に廃棄されるGCを
|
||||
作成します。スクリプトが、<filename>-gc</filename>オプションを指定すると、
|
||||
グラフィック・コンテキスト・オブジェクトの名前をコマンドに渡すことができます。
|
||||
このGCはコマンドの解釈に使用され、変数は、コマンドが行うGCの変更によって更新
|
||||
されます。</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2" colsep="0" rowsep="0">
|
||||
<?PubTbl tgroup dispwid="6.54in">
|
||||
<colspec align="left" colwidth="201*">
|
||||
<colspec align="left" colwidth="338*">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-gc</filename> <<symbol role="Variable">GC</symbol>></para></entry>
|
||||
<entry align="left" valign="top"><para><symbol role="Variable"><GC></symbol>は、まだ初期化されていない環境変数、または前の描画コマンドの
|
||||
グラフィック・コンテキストを保持したままの環境変数の名前です。
|
||||
このオプションが指定されたとき、初めにGCオプションを指定し
|
||||
なければなりません。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-foreground</filename> <<symbol role="Variable">color</symbol>></para></entry>
|
||||
<entry align="left" valign="top"><para>フォアグランドのカラーを指定します。
|
||||
カラー名またはピクセル番号のどちらかで指定します。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-background</filename> <<symbol role="Variable">color</symbol>></para></entry>
|
||||
<entry align="left" valign="top"><para>バックグラウンドのカラーを指定します。
|
||||
カラー名またはピクセル番号のどちらかで指定します。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-font</filename> <<symbol role="Variable">font name</symbol>></para></entry>
|
||||
<entry align="left" valign="top"><para>使用するフォントの名前を指定します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-line_width</filename> <<symbol role="Variable">number</symbol>></para></entry>
|
||||
<entry align="left" valign="top"><para>描画中に使用する線の幅を指定します。</para></entry></row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-function</filename> <<symbol role="Variable">drawing function</symbol></para></entry>
|
||||
<entry align="left" valign="top"><para>描画関数を指定します。
|
||||
<command>xor, or, clear, and, copy, noop, nor, nand, set, invert, equiv,
|
||||
andReverse, orReverse,</command>または<command>copyInverted</command>
|
||||
を指定できます。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>-line_style</filename> <<symbol role="Variable">style</symbol>></para></entry>
|
||||
<entry align="left" valign="top"><para>線の形状を指定します。
|
||||
次の中から指定できます。
|
||||
<command>LineSolid</command>, <command>LineDoubleDash</command>,
|
||||
または<command>LineOnOffDash</command></para></entry></row></tbody></tgroup>
|
||||
</informaltable>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.adv.div.13">
|
||||
<title>ウィジェットのトランスレーションの設定<indexterm><primary>トランスレーション</primary>
|
||||
</indexterm><indexterm><primary>ウィジェット</primary><secondary>トランスレーション</secondary>
|
||||
</indexterm></title>
|
||||
<para><command>dtksh</command>は、Cプログラミング環境と同じように、ウィジェットのトランスレーションを増加、無効、
|
||||
削除する機能を提供しています。Cでは、アプリケーションは、トランスレーションの
|
||||
アクションのプロシージャのセットをインストールします。このセットは、特定の
|
||||
イベント・シーケンスに接続できます(トランスレーションはイベント・シーケンスと
|
||||
関連のあるアクション・プロシージャで構成されます)。<command>dtksh</command>の
|
||||
トランスレーションは、単一のアクション・プロシージャだけが使用可能なときを除いて、
|
||||
同様の方法で操作されます。このアクション・プロシージャは<filename>ksh_eval</filename>と呼ばれ、
|
||||
受け取ったいくつかのパラメータを<command>dtksh</command>コマンドとして解釈し、トランスレーションは
|
||||
起動時にそのパラメータを評価します。次のシェル・スクリプトのセグメントは、
|
||||
トランスレーションの使用する方法の例です。</para>
|
||||
<programlisting>BtnDownProcedure()
|
||||
{
|
||||
echo “Button Down event occurred in button “$1
|
||||
}
|
||||
XtCreateManagedWidget BUTTON1 button1 XmPushButton $PARENT \
|
||||
labelString:“Button 1“ \
|
||||
translations:'#augment
|
||||
<EnterNotify>:ksh_eval(“echo Button1 entered“)
|
||||
<Btn1Down>:ksh_eval(“BtnDownProcedure 1“)'
|
||||
XtCreateManagedWidget BUTTON2 button2 XmPushButton $PARENT \
|
||||
labelString:“Button 2“
|
||||
XtOverrideTranslations $BUTTON2 \
|
||||
'#override
|
||||
<Btn1Down>:ksh_eval(“BtnDownProcedure 2“)'</programlisting>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub Caret>
|
||||
<?Pub *0000029103>
|
||||
333
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch04.sgm
Normal file
333
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/ch04.sgm
Normal file
@@ -0,0 +1,333 @@
|
||||
<!-- $XConsortium: ch04.sgm /main/7 1996/09/08 19:46:13 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<chapter id="DKSUG.scr2.div.1">
|
||||
<title>複雑なスクリプト<indexterm><primary>複雑なスクリプト</primary></indexterm></title>
|
||||
<para>この章は、2章で説明したスクリプトよりも、さらに複雑なスクリプトについて説明します。
|
||||
このスクリプトは非常に長いため、スクリプト全体は、付録Cにリストします。
|
||||
このマニュアルは、KornShellプログラミングのチュートリアルではありません。
|
||||
KornShellプログラミングをあまり理解していない場合は、KornShellプログラミング用の
|
||||
マニュアルを入手し、参照してください。</para>
|
||||
<sect1 id="DKSUG.scr2.div.2">
|
||||
<title>script_findの使用方法</title>
|
||||
<para>スクリプト<indexterm><primary>script_find</primary></indexterm><filename>script_find</filename>は、<command>dtksh</command>を使用して、<command>find</command>コマンドのグラフィカル・インタフェースを
|
||||
提供する方法を示しています。<filename>script_find</filename>は、<command>find</command>コマンドのパラメータを
|
||||
指定できるウィンドウを生成します。スクリプトを完全に理解するには、<command>find</command>を理解し、
|
||||
マニュアル・ページを使用可能にしておく必要があります。<filename>script_find</filename>によって
|
||||
生成されるウィンドウ内の多くのトグル・ボタン・メニュー選択肢は、<command>find</command>コマンドの
|
||||
知識が多少必要です。</para>
|
||||
<para>スクリプトのウィンドウで、検索するディレクトリとファイル名を指定します。
|
||||
他のオプションで、検索用のファイル・システムの型と一致するファイルの型を
|
||||
制限できます。図4-1にscript_findのウィンドウを示します。</para>
|
||||
<figure>
|
||||
<title>script_findのウィンドウ</title>
|
||||
<graphic id="DKSUG.scr2.grph.1" entityref="DKSUG.scr2.fig.1"></graphic>
|
||||
</figure>
|
||||
<para>ウィンドウの上部にあるテキスト・フィールドに、捜したい検索ディレクトリとファイル名
|
||||
を入力します。そして、5つのトグル・ボタンから適用可能な選択(または選択肢)を
|
||||
選択します。オプション・メニューで、検索をさらに制限できます。必要な選択をすべて
|
||||
行ってから[OK]ボタンをクリックします。処理が正常に終ると、その後すぐに
|
||||
ウィンドウが現れ、<command>find</command>操作の結果が表示されます。検索ディレクトリ
|
||||
またはファイル名を指定しないと、または無効なディレクトリを指定すると、エラー・
|
||||
ダイアログが表示されます。たとえば、<filename>/users/dlm</filename>ディレクトリ
|
||||
下のどこに<filename>two_letter_calls</filename>というファイルがあるか捜しますとします。
|
||||
検索ディレクトリのテキスト・フィールドに、そのディレクトリを入力するときに、
|
||||
<filename>/users/dlm</filename>の代わりに<filename>/users/dln</filename>と誤って入力したと
|
||||
します。その状態で、[OK]または[Apply]をクリックすると、<filename>script_find</filename>は、<filename>/users/dln</filename>ディレクトリを見つけることができません。
|
||||
そのため、エラー・ダイアログを生成して、これをユーザに通知します。
|
||||
</para>
|
||||
<figure>
|
||||
<title>script_findエラー・ダイアログ</title>
|
||||
<graphic id="DKSUG.scr2.grph.2" entityref="DKSUG.scr2.fig.2"></graphic>
|
||||
</figure>
|
||||
<para>誤りを訂正すると、<filename>script_find</filename>は適切に実行し、要求したファイルの
|
||||
絶対パスを表示した<command>dtterm</command>ウィンドウを生成し、ファイルが見つかった
|
||||
ことを示します。</para>
|
||||
<figure>
|
||||
<title>絶対パスが示されているウィンドウ</title>
|
||||
<graphic id="DKSUG.scr2.grph.3" entityref="DKSUG.scr2.fig.3"></graphic>
|
||||
</figure>
|
||||
<para><filename>script_find</filename>が指定したディレクトリに見つからなかった時は、<command>dtterm</command>ウィンドウには何も表示されません。</para>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.scr2.div.3">
|
||||
<title>script_findの解析</title>
|
||||
<para><filename>script_find</filename>の構造は、Cプログラムと似ています。初めにいくつかの関数とコールバック、
|
||||
次にメイン・スクリプトが示されるという構造です。</para>
|
||||
<para>スクリプトの初めの2行は重要で、すべての<command>dtksh</command>スクリプトに含める
|
||||
必要があります。</para>
|
||||
<programlisting>#! /usr/dt/bin/dtksh
|
||||
. /usr/dt/lib/dtksh/DtFunc.dtsh</programlisting>
|
||||
<para>1行めは<command>dtksh</command>システムを実行します。2行めは<command>dtksh</command>簡易関数をロードします。
|
||||
2行めは、第2章で説明したスクリプトには使用されていません。それは、これらの
|
||||
スクリプトが<command>dtksh</command>簡易関数を使用しないためです。</para>
|
||||
<sect2 id="DKSUG.scr2.div.4">
|
||||
<title>関数とコールバック<indexterm><primary>コールバック</primary><secondary>script_find</secondary></indexterm></title>
|
||||
<para><filename>script_find</filename>には、次の関数とコールバックがあります。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><filename>PostErrorDialog()</filename></para>
|
||||
</listitem><listitem><para><filename>OkCallback()</filename></para>
|
||||
</listitem><listitem><para>LoadStickyValues()</para>
|
||||
</listitem><listitem><para><filename>EvalCmd()</filename></para>
|
||||
</listitem><listitem><para><filename>RetrieveAndSaveCurrentValues()</filename></para>
|
||||
</listitem></itemizedlist>
|
||||
<sect3 id="DKSUG.scr2.div.5">
|
||||
<title>PostErrorDialog()</title>
|
||||
<para>この関数は、ユーザが無効なディレクトリを入力したときなど、エラーの発見時に呼び
|
||||
出されます。この関数は、ダイアログ・ボックスを表示
|
||||
し、簡易関数<filename><indexterm><primary>DtkshDisplayErrorDialog</primary></indexterm>DtkshDisplayErrorDialog()</filename>を呼び出されます。
|
||||
この関数は、「Find Error」というタイトルで、呼び出した位置から渡される変数$1にメッセージが格納されているダイアログ・ボックスを表示します。</para>
|
||||
<programlisting>dialogPostErrorDialog()
|
||||
{
|
||||
DtDisplayErrorDialog “Find Error” “$1” \
|
||||
DIALOG_PRIMARY_APPLICATION_MODAL
|
||||
}</programlisting>
|
||||
<para>最後のパラメータ、<computeroutput>DIALOG_PRIMARY_APPLICATION_MODAL</computeroutput>は、他の相互動作が発生する前に
|
||||
応答しなければならないダイアログを生成するように<command>dtksh</command>に伝えます。</para>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.6">
|
||||
<title>OkCallback()</title>
|
||||
<para><filename>OkCallback()</filename>は、メインの<filename>script_find</filename>ウィンドウ上の[OK]または[Apply]ボタンの
|
||||
どちらかを押されると呼び出されます。 [OK]をボタンを押すと、script_findウィンドウ
|
||||
は管理されなくなります。[OK]または[Apply]ボタンで、入力した検索ディレクトリを
|
||||
確認します。それが無効な場合、<filename>OkCallback()</filename>は、<filename>PostErrorDialog()</filename>を
|
||||
呼び出します。それが有効な場合は、<filename>script_find</filename>のトグル・ボタンの状態がチェックされ、
|
||||
その状態と一致するように、変数<filename>$CMD</filename>を調整します。
|
||||
この変数には、最後に実行されるコマンドのすべてが含まれます。</para>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.7">
|
||||
<title>LoadStickyValues()</title>
|
||||
<para>この関数は、ウィンドウが生成および管理された後、メイン・プリグラムから呼び出され
|
||||
ます。スクリプトの最新の実行結果から、すべての値をロードします。
|
||||
それらの値は<filename>RetrieveandSaveCurrentValues()</filename>関数によって、<filename>Find.sticky</filename>ファイルに保存されます。
|
||||
</para>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.8">
|
||||
<title>EvalCmd()</title>
|
||||
<para><filename>EvalCmd()</filename>は<filename>LoadStickyValues()</filename>で使用され、<command>dtksh</command>コマンドとして<filename>Find.sticky</filename>の各行を評価します。
|
||||
<filename>Find.sticky</filename>ファイル内のリストが次のとおりです。</para>
|
||||
<programlisting>XmTextSetString $SD “/users/dlm”<indexterm>
|
||||
<primary>XmTextSetString</primary></indexterm>
|
||||
XmTextFieldSetInsertionPosition $SD 10<indexterm><primary>XmTextFieldSetInsertionPosition</primary></indexterm>
|
||||
XmTextSetString $FNP “two_letter_calls”<indexterm><primary>XmTextSetString</primary></indexterm>
|
||||
XmTextFieldSetInsertionPosition $FNP 16<indexterm><primary>XmTextFieldSetInsertionPosition</primary></indexterm>
|
||||
XtSetValues $FSTYPE menuHistory:$NODIR<indexterm><primary>XtSetValues</primary>
|
||||
</indexterm>
|
||||
XtSetValues $FILETYPE menuHistory:$NOTYPE<indexterm><primary>XtSetValues</primary>
|
||||
</indexterm>
|
||||
XmToggleButtonSetState $T2 true false<indexterm><primary>XmToggleButtonSetState</primary></indexterm>
|
||||
XmToggleButtonSetState $T4 true false<indexterm><primary>XmToggleButtonSetState</primary></indexterm></programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.9">
|
||||
<title>RetrievAndSaveCurrentValues()</title>
|
||||
<para><filename>RetrieveAndSaveCurrentValues()</filename>は、<filename>script_find</filename>ウィンドウにあるウィジェットの現在の設定と値を
|
||||
検索し、それらを<filename>Find.sticky</filename>ファイルに保存します。
|
||||
<filename>Find.sticky</filename>ファイルは、次にスクリプトが実行される時に、
|
||||
<filename>LoadStickyValues()</filename>によって使用されます。</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
<sect2 id="DKSUG.scr2.div.10">
|
||||
<title>メイン・スクリプト</title>
|
||||
<para>スクリプトの残りは、Cプログラムの<filename>Main()</filename>に相当するものです。Xtイントリンシクス
|
||||
を初期化し、<filename>script_find</filename>ウィンドウで使用するすべてのウィジェットを生成します。
|
||||
1行めの<command>set -f</command>は、<command>dtksh</command>に対し、パス名にあるワイルドカードの文字列の
|
||||
拡張を禁止するよう指示しています。これは、<command>find</command>コマンドがこの拡張を実行できる
|
||||
ようにするために必要です。</para>
|
||||
<para><filename>script_find</filename>ウィンドウ(図4-4参照)は、4つの領域をもつフォーム・ウィジェットから
|
||||
構成されます。領域は、セパレータ・ウィジェットによって明確にされています。
|
||||
それぞれの領域にはいくつかのウィジェットがあり、そのすべてがフォーム・ウィジェット
|
||||
の子になります。
|
||||
</para>
|
||||
<figure>
|
||||
<title> script_findウィンドウにあるウィジェット</title>
|
||||
<graphic id="DKSUG.scr2.grph.4" entityref="DKSUG.scr2.fig.4"></graphic>
|
||||
</figure>
|
||||
<para>ウィジェットは、領域ごとに順番に、上から下へ作成されます。</para>
|
||||
<sect3 id="DKSUG.scr2.div.11">
|
||||
<title>初期化</title>
|
||||
<para>初期化は、次のようなXtイントリンシクス関数<command>XtInitialize</command>で行います。</para>
|
||||
<programlisting>XtInitialize TOPLEVEL find Dtksh $0 “${@:-}”<indexterm>
|
||||
<primary>XtInitialize</primary></indexterm></programlisting>
|
||||
<para>これは、次に生成されるフォーム・ウィジェットの親であるトップレベル・
|
||||
シェルを生成します。</para>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.12">
|
||||
<title>フォーム・ウィジェットの生成<indexterm><primary>ウィジェット</primary><secondary>フォーム</secondary></indexterm><indexterm><primary>フォーム・ウィジェットの生成</primary>
|
||||
</indexterm></title>
|
||||
<para>メインの親ウィジェットとしてフォーム・ウィジェットを使用します。
|
||||
フォーム・ウィジェットは、ユーザが子ウィジェットを抑制できるマネージャ・
|
||||
ウィジェットです。メインの<filename>script_find</filename>ウィンドウにあるほとんどのウィジェットが
|
||||
フォーム・ウィジェットの子です。残りのウィジェットの作成の説明は、ウィンドウの
|
||||
4つの領域(図4-4参照)ごとに説明します。</para>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.13">
|
||||
<title>1つめの領域</title>
|
||||
<para>1つめの領域は、2つのラベル・ウィジェットと2つのテキストフィールド・ウィジェット、
|
||||
および1つめと2つめの領域を区切るセパレータから構成されています。</para>
|
||||
<figure>
|
||||
<title><filename>script_find</filename>ウィンドウの1つめの領域</title>
|
||||
<graphic id="DKSUG.scr2.grph.5" entityref="DKSUG.scr2.fig.5"></graphic>
|
||||
</figure>
|
||||
<para>次のコードの部分は、1つめのラベル・ウィジェットを生成および配置し、<command>DtkshAnchorTop</command>
|
||||
および<command>DtkshAnchorLeft</command>簡易関数を使用して、フォーム・ウィジェットにそれを
|
||||
配置します。</para>
|
||||
<programlisting>XtCreateManagedWidget SDLABEL sdlabel XmLabel $FORM \<indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm>
|
||||
labelString:”Search Directory:” \
|
||||
$(DtkshAnchorTop 12) \
|
||||
$(DtkshAnchorLeft 10)</programlisting>
|
||||
<para>次のコードの部分は、1つめのテキストフィールド・ウィジェットを生成および配置
|
||||
しています。このウィジェットは、フォーム・ウィジェットとラベル・ウィジェットの
|
||||
両方に関連して配置されます。</para>
|
||||
<programlisting>XtCreateManagedWidget SD sd XmText $FORM \<indexterm><primary>XtCreateManagedWidget</primary></indexterm>
|
||||
columns:30 \
|
||||
value:”.” \
|
||||
$(DtkshAnchorTop 6) \
|
||||
$(DtkshRightOf $SDLABEL 10) \
|
||||
$(DtkshAnchorRight 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
XmTextFieldSetInsertionPosition $SD 1<indexterm><primary>XmTextFieldSetInsertionPosition</primary></indexterm></programlisting>
|
||||
<para>残りのラベル・ウィジェットとテキストフィールト・ウィジェットは、同じ方法で生成
|
||||
されます。</para>
|
||||
<para>セパレータ・ウィジェットはフォーム・ウィジェットの子として生成され、2つめのテキストフィールドの下に配置されます。<indexterm><primary>ウィジェット</primary><secondary>セパレータ・ウィジェット</secondary></indexterm><indexterm><primary>セパレータ・ウィジェットはの生成</primary></indexterm></para>
|
||||
<programlisting>XtCreateManagedWidget SEP sep XmSeparator $FORM \<indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm>
|
||||
separatorType:SINGLE_DASHED_LINE \
|
||||
$(DtkshUnder $FNP 10) \
|
||||
$(DtkshSpanWidth)</programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.14">
|
||||
<title>2つめの領域</title>
|
||||
<para>2つめの領域は、1つのローカラム・ウィジェット、5つのトグルボタン・ガジェット、
|
||||
およびセパレータ・ウィジェットから構成されます。</para>
|
||||
<figure>
|
||||
<title><filename>script_find</filename>ウィンドウの2つめの領域</title>
|
||||
<graphic id="DKSUG.scr2.grph.6" entityref="DKSUG.scr2.fig.6"></graphic>
|
||||
</figure>
|
||||
<para>ガジェットは、多くの属性を、その親に依存するウィジェットで、メモリ・リソースを節約できます。</para>
|
||||
<para>ローカラム・ウィジェットは、フォーム・ウィジェットの子として生成され、1つめの
|
||||
領域に生成されたセパレータ・ウィジェットの直下に配置されます。
|
||||
</para>
|
||||
<programlisting>XtCreateManagedWidget RC rc XmRowColumn $FORM \<indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm>
|
||||
orientation:HORIZONTAL \
|
||||
numColumns:3 \
|
||||
packing:PACK_COLUMN \
|
||||
$(DtkshUnder $SEP 10) \
|
||||
$(DtkshSpanWidth 10 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP</programlisting>
|
||||
<para>5つのトグルボタン・ガジェットは、<command>DtkshAddButtons</command>簡易関数を使用して、
|
||||
ローカラム・ウィジェットの子として生成されます。</para>
|
||||
<programlisting>DtkshAddButtons -w $RC XmToggleButtonGadget \<indexterm><primary>DtkshAddButtons</primary></indexterm>
|
||||
T1 “Cross Mount Points” ““\
|
||||
T2 “Print Matching Filenames” ““\
|
||||
T3 “Search Hidden Subdirectories” ““\
|
||||
T4 “Follow Symbolic Links” ““\
|
||||
T5 “Descend Subdirectories First” ““</programlisting>
|
||||
<para>次にセパレータ・ウィジェットが生成され、2つめと3つめの領域を区切ります。
|
||||
このセパレータ・ウィジェットIDは、<filename>SEP2</filename>と呼ばれています。
|
||||
</para>
|
||||
<programlisting>XtCreateManagedWidget SEP2 sep XmSeparator $FORM \<indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm>
|
||||
separatorType:SINGLE_DASHED_LINE \
|
||||
$(DtkshUnder $RC 10) \
|
||||
$(DtkshSpanWidth)</programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.15">
|
||||
<title>3つめの領域</title>
|
||||
<para>3つめの領域は、2つのオプション・メニューとセパレータ・ウィジェットから生成されます。
|
||||
</para>
|
||||
<figure>
|
||||
<title><filename>script_find</filename>ウィンドウの3つめの領域</title>
|
||||
<graphic id="DKSUG.scr2.grph.7" entityref="DKSUG.scr2.fig.7"></graphic>
|
||||
</figure>
|
||||
<para>オプション・メニューは、プルダウン・メニューです。ユーザがオプション・メニュー・
|
||||
ボタンをクリックすると、多数の選択肢をもつメニュー区画が現れます。ユーザは、適切
|
||||
な選択肢にポインタをドラッグし、マウス・ボタンを離します。メニュー区画は消え、
|
||||
オプション・メニュー・ボタンのラベルに新しい選択肢が表示されます。<indexterm>
|
||||
<primary>メニューの作成</primary></indexterm><indexterm><primary>メニューの作成</primary></indexterm></para>
|
||||
<para>1つめのオプション・メニューのメニュー区画は、多数のプッシュ・ボタン・ガジェット
|
||||
から構成され、<command>find</command>コマンドに強いることができる様々な制約を表示しています。</para>
|
||||
<programlisting>XmCreatePulldownMenu PANE $FORM pane <indexterm><primary>XmCreatePulldownMenu</primary></indexterm>
|
||||
DtkshAddButtons -w $PANE XmPushButtonGadget \<indexterm><primary>DtkshAddButtons</primary></indexterm>
|
||||
NODIR “no restrictions” ““\
|
||||
NFS “nfs” ““\
|
||||
CDFS “cdfs” ““\
|
||||
HFS “hfs” ““
|
||||
Next, the Option Menu button itself is created and managed, with the
|
||||
menu pane just created (<filename>$PANE</filename>) identified as a <command>subMenuId</command>:
|
||||
XmCreateOptionMenu FSTYPE $FORM fstype \<indexterm><primary>XmCreateOptionMenu</primary></indexterm>
|
||||
labelString:”Restrict Search To File System Type:” \
|
||||
menuHistory:$NODIR \
|
||||
subMenuId:$PANE \
|
||||
$(DtkshUnder $SEP2 20) \
|
||||
$(DtkshSpanWidth 10 10) \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP
|
||||
XtManageChild $FSTYPE<indexterm><primary>XtManageChild</primary></indexterm></programlisting>
|
||||
<para>2つめのオプション・メニュー・ボタンも、同じ方法で生成されます。このボタンは、
|
||||
<command>find</command>コマンドに、さらに制約を与えます。</para>
|
||||
<para>3つめのセパレータは、他のセパレータと同じ方法で生成されます。
|
||||
</para>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.16">
|
||||
<title>4つめの領域</title>
|
||||
<para>4つめの領域は、フォーム・ウィジェットの子である4つのプッシュ・ボタンから構成され
|
||||
ています。</para>
|
||||
<graphic id="DKSUG.scr2.igrph.1" entityref="DKSUG.scr2.fig.8"></graphic>
|
||||
<para>4つのプッシュ・ボタンは次のように使用されます。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para>[OK]は、<filename>script_find</filename>ウィンドウに入力されたパラメータで<command>find</command>コマンドを
|
||||
実行し、<filename>script_find</filename>ウィンドウを閉じます。</para>
|
||||
</listitem><listitem><para>[Apply]は、<filename>script_find</filename>ウィンドウに入力されたパラメータで<command>find</command>コマンドを実行します。
|
||||
<filename>script_find</filename>ウィンドウは閉じません。</para>
|
||||
</listitem><listitem><para>[Close]は、<command>find</command>コマンドを実行せずに<filename>script_find</filename>を終了します。</para>
|
||||
</listitem><listitem><para>[Help]は、<filename>script_find</filename>の使用に関する情報を示すダイアログ・ボックスを生成します。</para>
|
||||
</listitem></itemizedlist>
|
||||
<para>プッシュ・ボタンは、それぞれ異なったラベルが付きますが、他のウィジェットとほとんど
|
||||
同じ方法で生成および配置されます。
|
||||
次のコードの部分は、[OK]ボタンを生成する方法を示しています。</para>
|
||||
<programlisting>XtCreateManagedWidget OK ok XmPushButton $FORM \<indexterm>
|
||||
<primary>XtCreateManagedWidget</primary></indexterm>
|
||||
labelString:”Ok” \
|
||||
$(DtkshUnder $SEP3 10) \
|
||||
$(DtkshFloatLeft 4) \
|
||||
$(DtkshFloatRight 24) \
|
||||
$(DtkshAnchorBottom 10)
|
||||
XtAddCallback $OK activateCallback “OkCallback”<indexterm><primary>XtAddCallback</primary></indexterm></programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.17">
|
||||
<title>オペレーティング・パラメータの設定</title>
|
||||
<para><command>XtSetValues</command>は、最初のオペレーティング・パラメータを設定するのに使用します。</para>
|
||||
<programlisting>XtSetValues $FORM \<indexterm><primary>XtSetValues</primary>
|
||||
</indexterm>
|
||||
initialFocus:$SD \
|
||||
defaultButton:$OK \
|
||||
cancelButton:$CLOSE \
|
||||
navigationType:EXCLUSIVE_TAB_GROUP</programlisting>
|
||||
<itemizedlist remap="Bullet1"><listitem><para>最初のフォーカスは、1つめの領域の最初のテキストフィールド・ウィジェットに設定
|
||||
されます。</para>
|
||||
</listitem><listitem><para>デフォルト・ボタンは4つめの領域の[OK]ボタンに設定されます。</para>
|
||||
</listitem><listitem><para>取消しボタンは4つめの領域の[Close]ボタンに設定されます。</para>
|
||||
</listitem><listitem><para>ナビゲーション型は<computeroutput>EXCLUSIVE_TAB_GROUP.</computeroutput>に設定されます。</para>
|
||||
</listitem></itemizedlist>
|
||||
<para>次の行は、改行キーがフォーム・ウィジェット内でデフォルト・ボタンをアクティブに
|
||||
しないテキストフィールド・ウィジェットを構成します。使用方法の詳細は、付録Bの
|
||||
<computeroutput>EXCLUSIVE_TAB_GROUP</computeroutput>の説明を参照してください。</para>
|
||||
<programlisting>DtkshSetReturnKeyControls $SD $FNP $FORM $OK</programlisting>
|
||||
</sect3>
|
||||
<sect3 id="DKSUG.scr2.div.18">
|
||||
<title>認識とループ</title>
|
||||
<para>スクリプトの最後の3行は、<filename>script_find</filename>ウィンドウの前の値をロードし、
|
||||
トップレベル・ウィジェットを実現します。そして、ユーザの入力を待つループに入り
|
||||
ます。</para>
|
||||
<programlisting>LoadStickyValues
|
||||
XtRealizeWidget $TOPLEVEL<indexterm><primary>XtRealizeWidget</primary></indexterm>
|
||||
XtMainLoop<indexterm><primary>XtMainLoop</primary></indexterm><?Pub Caret></programlisting>
|
||||
</sect3>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub *0000021832>
|
||||
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area1.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area1.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area2.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area2.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area3.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area3.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area4.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/area4.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/dttest1.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/dttest1.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/finderr.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/finderr.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/findterm.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/findterm.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/findwin.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/findwin.tif
Normal file
Binary file not shown.
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/labfindw.tif
Normal file
BIN
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/graphics/labfindw.tif
Normal file
Binary file not shown.
183
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/preface.sgm
Normal file
183
cde/doc/ja_JP.dt-eucJP/guides/dtkshGuide/preface.sgm
Normal file
@@ -0,0 +1,183 @@
|
||||
<!-- $XConsortium: preface.sgm /main/8 1996/08/25 15:09:35 rws $ -->
|
||||
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
|
||||
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
|
||||
<!-- (c) Copyright 1995 International Business Machines Corp. -->
|
||||
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
|
||||
<!-- (c) Copyright 1995 Novell, Inc. -->
|
||||
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
|
||||
<!-- (c) Copyright 1995 Hitachi. -->
|
||||
<preface id="DKSUG.Pref.div.1">
|
||||
<title>はじめに</title>
|
||||
<para><emphasis>共通デスクトップ環境 デスクトップ KornShell ユーザーズガイド</emphasis>は、KornShell(kshell)で、Motif
|
||||
アプリケーションを作成するために必要な情報を提供しています。はじめに必要な基本的
|
||||
な情報に加えて、複雑さの増したいくつかのスクリプト例を説明します。
|
||||
このガイドを通して、<Command>dtksh</Command>という用語は、デスクトップのKornShell
|
||||
を意味しています。</para>
|
||||
<sect1 id="DKSUG.Pref.div.2">
|
||||
<title>対象読者</title>
|
||||
<para>このガイドは、Motifアプリケーションを早くかつ簡単に作成したいが、Cプログ ラミング
|
||||
言語を使用する時間や知識がない、またはC言語を使用したくないプログラマの方を対象
|
||||
としています。kshellのプログラミング、Motif、Xtイントリンシクス、Xlibをよく理解
|
||||
している必要があります。C言語に関する理解も役立ちます。</para>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.Pref.div.3">
|
||||
<title>マニュアルの構成</title>
|
||||
<para><emphasis role="Lead-in">第1章「デスクトップKornShellの紹介」</emphasis>は、<command>dtksh</command>スクリプトでMotifアプリケーションを
|
||||
記述し始めるときに必要な基本的な情報について説明ます。</para>
|
||||
<para><emphasis role="Lead-in">第2章「スクリプト例」</emphasis>は2つの簡単な<command>dtksh</command>スクリプトについて説明します。
|
||||
1つめのスクリプトは、プリテン・ボード・ウィジェットにプッシュ・ボタンを作成しま
|
||||
す。2つめのスクリプトは、1つめのスクリプトを拡張して、プッシュ・ボタンにコール
|
||||
バックを追加します。</para>
|
||||
<para><emphasis role="Lead-in">第3章「上級トピック」</emphasis>は、<command>dtksh</command>スクリプトに関するより上級のトピックについて
|
||||
説明します。</para>
|
||||
<para><emphasis role="Lead-in">第4章「複雑なスクリプト」</emphasis>第2章で説明したスクリプトに比べてかなり複雑なスクリプトについて
|
||||
説明します。このスクリプトは、<command>find</command>コマンドに対するグラフィック・インタフェース
|
||||
作成しています。</para>
|
||||
<para><emphasis role="Lead-in">付録A「dtkshコマンド」</emphasis>すべての<command>dtksh</command>コマンドのリストを示します。</para>
|
||||
<para><emphasis role="Lead-in">付録B「dtksh簡易関数」</emphasis>は、他のマニュアルには記述されていないコマンドまたは
|
||||
ドキュメントのマニュアル・ページで構成されています。</para>
|
||||
<para><emphasis role="Lead-in">付録C「script_findスクリプトのリスト」</emphasis>は、第4章で説明した複雑なスクリプトの完成したリストを示します。</para>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.Pref.div.4">
|
||||
<title>関連文書</title>
|
||||
<para>以下の文書に、kshellKのプログラミング、Motif、Xtイントリンシクス、Xlibの情報が記載されています。</para>
|
||||
<itemizedlist remap="Bullet1"><listitem><para><emphasis>Desktop KornShell
|
||||
Graphical Programming For the Common Desktop Environment Version 1.0,</emphasis>
|
||||
by J. Stephen Pendergrast, Jr., published by Addison-Wesley, Reading, MA
|
||||
01867.</para>
|
||||
</listitem><listitem><para><emphasis>The New KornShell Command and Programming
|
||||
Language</emphasis>, by Morris I. Bolsky and David G. Korn, published by
|
||||
Prentice-Hall, Englewood Cliffs, NJ 07632.</para>
|
||||
</listitem><listitem><para><emphasis>KornShell Programming Tutorial</emphasis>,
|
||||
by Barry Rosenberg, published by Addison-Wesley, Reading, MA 01867.</para>
|
||||
</listitem><listitem><para><emphasis>Motif Programmer's Guide</emphasis>,
|
||||
Open Software Foundation, 11 Cambridge Center, Cambridge, MA 02142, published
|
||||
by Prentice-Hall, Englewood Cliffs, NJ 07632.</para>
|
||||
</listitem><listitem><para><emphasis>Motif Programmer's Reference</emphasis>,
|
||||
Open Software Foundation, 11 Cambridge Center, Cambridge, MA 02142, published
|
||||
by Prentice-Hall, Englewood Cliffs, NJ 07632.</para>
|
||||
</listitem><listitem><para><emphasis>Motif Reference Guide</emphasis>,
|
||||
by Douglas A. Young, published by Prentice-Hall, Englewood Cliffs, NJ 07632.
|
||||
</para>
|
||||
</listitem><listitem><para><emphasis>Mastering Motif Widgets</emphasis> (Second
|
||||
Edition), by Donald L. McMinds, published by Addison-Wesley, Reading, MA
|
||||
01867</para>
|
||||
</listitem><listitem><para><emphasis>The X Window System Programming and Applications
|
||||
with Xt Motif Edition</emphasis>, by Douglas A. Young, published by Prentice-Hall,
|
||||
Englewood Cliffs, NJ 07632.</para>
|
||||
</listitem><listitem><para><emphasis>The Definitive Guides to the X Window
|
||||
System, Volume 1: Xlib Programming Manual</emphasis>, by Adrian Nye, published
|
||||
by O'Reilly and Associates, Sebastopol, CA 95472.</para>
|
||||
</listitem><listitem><para><emphasis>The Definitive Guides to the X Window
|
||||
System, Volume 2: Xlib Reference Manual</emphasis>, edited by Adrian Nye,
|
||||
published by O'Reilly and Associates, Sebastopol, CA 95472.</para>
|
||||
</listitem><listitem><para><emphasis>The Definitive Guides to the X Window
|
||||
System, Volume 3: X Window System User's Guide</emphasis>, by Valerie Quercia
|
||||
and Tim O'Reilly, published by O'Reilly and Associates, Sebastopol, CA 95472.
|
||||
</para>
|
||||
</listitem><listitem><para><emphasis>The Definitive Guides to the X Window
|
||||
System, Volume 4: X Toolkit Intrinsics Programming Manual</emphasis>, by
|
||||
Adrian Nye and Tim O'Reilly, published by O'Reilly and Associates, Sebastopol,
|
||||
CA 95472.</para>
|
||||
</listitem><listitem><para><emphasis>The Definitive Guides to the X Window
|
||||
System, Volume 5: X Toolkit Intrinsics Reference Manual,</emphasis> edited
|
||||
by Tim O'Reilly, published by O'Reilly and Associates, Sebastopol, CA 95472.
|
||||
</para>
|
||||
</listitem><listitem><para><emphasis>The Definitive Guides to the X Window
|
||||
System, Volume 6: Motif Programming Manual</emphasis>, by Dan Heller, published
|
||||
by O'Reilly and Associates, Sebastopol, CA 95472.</para>
|
||||
</listitem></itemizedlist>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.Pref.div.4a">
|
||||
<title>DocBook SGMLのマークアップの規則</title>
|
||||
<para>この本は、DocBook文書型定義(DTD)を使用したStructured Generalized Markup Language (SGML) で記述されています。
|
||||
次の表で、様々な意味で使用されているDocBookのマークアップについて説明します。
|
||||
</para>
|
||||
<table id="DKSUG.Pref.tbl.1" frame="Topbot">
|
||||
<title>DocBook SGMLのマークアップ</title>
|
||||
<tgroup cols="3" colsep="0" rowsep="0">
|
||||
<colspec colwidth="1.65in">
|
||||
<colspec colwidth="2.63in">
|
||||
<colspec colwidth="2.92in">
|
||||
<thead>
|
||||
<row>
|
||||
<entry align="left" valign="bottom"><para><literal>マークアップ表示</literal></para></entry>
|
||||
|
||||
<entry align="left" valign="bottom"><para><literal>意味</literal></para></entry>
|
||||
<entry align="left" valign="bottom"><para><literal>使用例</literal></para></entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><command>AaBbCc123</command></para></entry>
|
||||
<entry align="left" valign="top"><para>コマンド名</para></entry>
|
||||
<entry align="left" valign="top"><para><command>ls</command> コマンドを使用してすべてのファイルをリストします。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><literal>AaBbCc123</literal></para></entry>
|
||||
<entry align="left" valign="top"><para>コマンド・オプション名</para></entry>
|
||||
<entry align="left" valign="top"><para> <command>ls</command> <literal>−a</literal>
|
||||
を使用してすべてのファイルをリストします。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><symbol role="Variable">AaBbCc123</symbol></para></entry>
|
||||
<entry align="left" valign="top"><para>コマンド行の位置フォルダ:
|
||||
実際に使用する特定の名前または値に置換されます。</para></entry>
|
||||
<entry align="left" valign="top"><para>ファイルを削除するには、<command>rm</command> <symbol role="Variable">filename</symbol>を使用します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>AaBbCc123</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>ファイルおよびディレクトリの名前</para></entry>
|
||||
<entry align="left" valign="top"><para><filename>.login</filename>ファイルを編集します。</para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><emphasis>AaBbCc123</emphasis></para></entry>
|
||||
<entry align="left" valign="top"><para>本のタイトル、新しい語句、または強調したい語句</para></entry>
|
||||
<entry align="left" valign="top"><para><emphasis>ユーザーズ・ガイド</emphasis>の第6章を
|
||||
参照してください。
|
||||
これらは<emphasis>クラス</emphasis>オプションとよばれています。
|
||||
これは<emphasis>ルートで行わなければいけません。</emphasis></para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para>[ ]</para></entry>
|
||||
<entry align="left" valign="top"><para>アイコン、ボタン、メニューなどのラベル名</para></entry>
|
||||
<entry align="left" valign="top"><para>[了解]ボタン</para></entry>
|
||||
</row></tbody></tgroup></table>
|
||||
</sect1>
|
||||
<sect1 id="DKSUG.Pref.div.5">
|
||||
<title>シェルのプロンプト文字</title>
|
||||
<para>次の表は、この本で使用しているシェルのプロンプト文字を示しています。</para>
|
||||
<table id="DKSUG.Pref.tbl.2" frame="Topbot">
|
||||
<title>シェルのプロンプト文字</title>
|
||||
<tgroup cols="3" colsep="0" rowsep="0">
|
||||
<?PubTbl tgroup dispwid="6.33in">
|
||||
<colspec colname="col1" colwidth="128*">
|
||||
<colspec colname="col2" colwidth="201*">
|
||||
<colspec colname="col3" colwidth="193*">
|
||||
<spanspec nameend="col2" namest="col1" spanname="1to2">
|
||||
<thead>
|
||||
<row><entry align="left" valign="bottom"><para><literal>文字</literal></para></entry><entry align="left" valign="bottom"><para><literal>意味</literal></para></entry><entry align="left" valign="bottom"><para><literal>例</literal></para></entry></row></thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>%</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>UNIX Cシェルのプロンプト</para></entry>
|
||||
<entry align="left" valign="top"><para><filename>system%</filename></para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>$</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>UNIX BourneおよびKorn シェルのプロンプト
|
||||
</para></entry>
|
||||
<entry align="left" valign="top"><para><filename>system$</filename></para></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="left" valign="top"><para><filename>#</filename></para></entry>
|
||||
<entry align="left" valign="top"><para>すべてのシェルのスーパーユーザのプロンプト</para></entry>
|
||||
<entry align="left" valign="top"><para><filename>system#</filename></para></entry>
|
||||
</row></tbody></tgroup><?Pub Caret></table>
|
||||
<note>
|
||||
<para>(バックスラッシュ)は、デバイスによって¥(円記号)で
|
||||
表示されるものがあります。</para>
|
||||
</note>
|
||||
</sect1>
|
||||
</preface>
|
||||
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 10:26:11-->
|
||||
<?Pub *0000010499>
|
||||
Reference in New Issue
Block a user