スライダーには以下の種類がある。
intとfloatのスライダーの違いは整数値をとるか、実数値をとるかの違いだけである。
ここではfloatSliderGrpについて使用例を示す。
window -title "slider1";
columnLayout;
text -label "make Sphere";
floatSliderGrp -label "Radius" -field true
-min 0.1 -max 20.0 -step 0.1 -value 1.0 radiusSlider;
button -label "OK"
-command "$sphereRadius = `floatSliderGrp -q -value radiusSlider`;\
sphere -r $sphereRadius";
showWindow;
window -title "slider1";
columnLayout;
text -label "make Sphere";
textコマンドはウインドウ内にテキストを表示するものである。
floatSliderGrp -label "Radius" -field true
-min 0.1 -max 20.0 -step 0.1 -value 1.0 radiusSlider;
floatSliderGrpの各フラグの意味
button -label "OK"
-command "$sphereRadius = `floatSliderGrp -q -value radiusSlider`;\
sphere -r $sphereRadius";
-commandの後のMELコマンドは;で区切ることによって複数のコマンドを実行できる。
その際、読みやすくするために途中に改行を含める時には改行の前に\(バックスラッシュ)をいれておく。
showWindow;
ウインドウを表示する。