This is how you get data into a widget (many widgets support <input file> but the checkbox doesn't [yet] so we can use <input> instead):
Code: Select all
#!/bin/sh
GTKDIALOG=gtkdialog
inputfile1=`mktemp`
inputfile2=`mktemp`
inputfile3=`mktemp`
inputfile4=`mktemp`
echo true > $inputfile1
echo false > $inputfile2
echo true > $inputfile3
echo false > $inputfile4
export MAIN_DIALOG='
<window title="Miriam - CheckBox Setting States" resizable="false">
<vbox>
<hbox>
<frame Group 1>
<checkbox>
<variable>chkGroup1CheckBox1</variable>
<label>CheckBox 1</label>
<input>cat '$inputfile1'</input>
</checkbox>
<checkbox>
<variable>chkGroup1CheckBox2</variable>
<label>CheckBox 2</label>
<input>cat '$inputfile2'</input>
</checkbox>
<checkbox>
<variable>chkGroup1CheckBox3</variable>
<label>CheckBox 3</label>
<input>cat '$inputfile3'</input>
</checkbox>
<checkbox>
<variable>chkGroup1CheckBox4</variable>
<label>CheckBox 4</label>
<input>cat '$inputfile4'</input>
</checkbox>
<hseparator></hseparator>
<togglebutton>
<variable>tgbGroup1</variable>
<label>Toggle All</label>
<action>echo $tgbGroup1 > '$inputfile1'</action>
<action>echo $tgbGroup1 > '$inputfile2'</action>
<action>echo $tgbGroup1 > '$inputfile3'</action>
<action>echo $tgbGroup1 > '$inputfile4'</action>
<action>refresh:chkGroup1CheckBox1</action>
<action>refresh:chkGroup1CheckBox2</action>
<action>refresh:chkGroup1CheckBox3</action>
<action>refresh:chkGroup1CheckBox4</action>
</togglebutton>
</frame>
</hbox>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --program=MAIN_DIALOG
rm $inputfile1 $inputfile2 $inputfile3 $inputfile4
Thunor