The timer widget monitors this file and, when the file changed, emits a "file-changed" signal. I have no idea why the signal is emitted twice.
IMO using the timer widget in this way makes little sense.
Interesting detail: The widget allows more than one input file. Add an <input file> tag for each file and the timer widget will emit a signal when any of these files change.
Code: Select all
#!/bin/bash
touch /tmp/myfile
echo '
<button>
<variable>BUT</variable>
<label>press me</label>
<action>date > /tmp/myfile</action>
</button>
<timer visible="true" milliseconds="true" file-monitor="true">
<input file>/tmp/myfile</input>
<action signal="file-changed">echo "working signal"</action>
</timer>
'| gtkdialog -s