目次
前
次
ボタンオブジェクト生成
エントリーオブジェクトを生成したので、次は
ボタンオブジェクトを扱います。
GUIのオブジェクトにするので、表示内容と
メソッドコードに分けて考えます。
ボタンオブジェクトは、以下の6種とします。
- Load
- Save
- Exec
- Cancel
- Clear
- exit
ボタンオブジェクトは、コマンド「button」を利用
するので、スクリプトで雛形を生成。
{
printf("button .btn%s -bg gray - text "%s" -command "%s"\n",$1,$1,$1)
}
メソッドは仮で決めておき、フォントを加えて定義しました。
button .btnLoad -font {{MS ゴシック} 16 bold} -bg gray -text "Load" -width 10 -command "fload"
button .btnSave -font {{MS ゴシック} 16 bold} -bg gray -text "Save" -width 10 -command "fsave"
button .btnExecute -font {{MS ゴシック} 16 bold} -bg gray -text "Exec" -width 10 -command "fexec"
button .btnCancel -font {{MS ゴシック} 16 bold} -bg gray -text "Cancel" -width 10 -command "fcancel"
button .btnExit -font {{MS ゴシック} 16 bold} -bg gray -text "exit" -width 10 -command "exit"
button .btnClear -font {{MS ゴシック} 16 bold} -bg gray -text "Clear" -width 10 -command "clrParameters"
ボタンオブジェクトと対応するメソッドは、以下。
- fload Load
- fsave Save
- fexec Exec
- fcancel Cancel
- clrParameters Clear
- exit exit
目次
前
次