目次

エントリーオブジェクト生成

 ラベルオブジェクトを生成したので、次は
 エントリーオブジェクトを扱います。

 オブジェクトを生成するのはスクリプトに一任して
 時間をかけないようにします。

 1行にオブジェクトの元になる文字列を並べて
 AWKでオブジェクト生成のコマンドを記述。

 オブジェクト一覧は、テキストファイルで次のように記述。

P0
P1
P2
P3
P4
P5

 エントリーには、温度と時刻があるので
 スクリプトは別にしておきます。

 温度用エントリーを生成するスクリプト。

{
  printf("entry .edt%sTemp -textvariable xexe_temp(%s) -width 10 -bg cyan\n",$1,$1)
}

 時刻用エントリーを生成するスクリプト。

{
  printf("entry .edt%sTime -textvariable xexe_time(%s) -width 10 -bg yellow\n",$1,$1)
}

 2つのAWKスクリプトでエントリーオブジェクトを生成し
 文字フォントの情報を追加しておきます。

entry .edtP0Temp -font {{MS ゴシック} 12 bold} -textvariable xexe_temp(P0) -width 10 -bg cyan
entry .edtP1Temp -font {{MS ゴシック} 12 bold} -textvariable xexe_temp(P1) -width 10 -bg cyan
entry .edtP2Temp -font {{MS ゴシック} 12 bold} -textvariable xexe_temp(P2) -width 10 -bg cyan
entry .edtP3Temp -font {{MS ゴシック} 12 bold} -textvariable xexe_temp(P3) -width 10 -bg cyan
entry .edtP4Temp -font {{MS ゴシック} 12 bold} -textvariable xexe_temp(P4) -width 10 -bg cyan
entry .edtP5Temp -font {{MS ゴシック} 12 bold} -textvariable xexe_temp(P5) -width 10 -bg cyan

entry .edtP0Time -font {{MS ゴシック} 12 bold} -textvariable xexe_time(P0) -width 10 -bg yellow
entry .edtP1Time -font {{MS ゴシック} 12 bold} -textvariable xexe_time(P1) -width 10 -bg yellow
entry .edtP2Time -font {{MS ゴシック} 12 bold} -textvariable xexe_time(P2) -width 10 -bg yellow
entry .edtP3Time -font {{MS ゴシック} 12 bold} -textvariable xexe_time(P3) -width 10 -bg yellow
entry .edtP4Time -font {{MS ゴシック} 12 bold} -textvariable xexe_time(P4) -width 10 -bg yellow
entry .edtP5Time -font {{MS ゴシック} 12 bold} -textvariable xexe_time(P5) -width 10 -bg yellow

 温度、時刻は、対象となるシステムで千差万別なので
 「-textvariable」のオプションでは、連想配列を使い
 可変できるようにします。

 温度、時刻のエントリーを背景色で区別できるように
 してあります。




目次

inserted by FC2 system