The output format is:
icon-name | stock-id | data0 | data1 ...
so two columns using <input file stock-column="0"> with "gtk-ok|row1" (missing data for column B) will output "|gtk-ok|row1|".
Using the same input format, "\n" (missing stock-id and missing column data) will output "|||".
Using the same input format, cut -d"|" -f2- /tmp/outputfile > /tmp/inputfile will prepare the output data for reinput.
The following example demonstrates this:
Code: Select all
#!/bin/sh
echo "gtk-ok|row1
|row2
|row3
" > /tmp/inputfile
echo '
<window>
<vbox>
<tree>
<label>A|B</label>
<variable>tree</variable>
<height>150</height>
<input file stock-column="0">/tmp/inputfile</input>
<output file>/tmp/outputfile</output>
</tree>
<hbox>
<button>
<label>Save and refresh</label>
<action>save:tree</action>
<action>cut -d"|" -f2- /tmp/outputfile > /tmp/inputfile</action>
<action>refresh:tree</action>
</button>
<button use-stock="true" label="gtk-quit"></button>
</hbox>
</vbox>
</window>
' | gtkdialog -s
For <input file icon-column="0"> use cut -d"|" -f2 --complement /tmp/outputfile > /tmp/inputfile
For <input file> use cut -d"|" -f3- /tmp/outputfile > /tmp/inputfile
Regards,
Thunor