I've attached them to my post on the previous page8-bit wrote:I could not get the checkmark png images for yes and no found and as a result, the one example does not work for me.
They are from the Elementary icon set.
I had used some other png files to get it to work, but I downloaded the ones from your post and they work too.thunor wrote:I've attached them to my post on the previous page8-bit wrote:I could not get the checkmark png images for yes and no found and as a result, the one example does not work for me.
They are from the Elementary icon set.
It's just an example for illustrative purposes which happens to default to yes.8-bit wrote:One thing I did notice is that a toggle configuration file is written when toggle is run. But even if I have the no.png images displayed when I stop the script, they are not retained for the next time toggle is run.
It always starts with the yes.png images.
So what is that configuration file for?
Code: Select all
echo 0 > TOGGLE; funcImageToggle
Code: Select all
if [ ! -f TOGGLE ]; then echo 0 > TOGGLE; funcImageToggle; fi
Code: Select all
#!/bin/bash
function funcImageToggle() {
if [ $(< TOGGLE) = 1 ]; then
ln -sf no.png toggle.png
echo 0 > TOGGLE
else
ln -sf yes.png toggle.png
echo 1 > TOGGLE
fi
}
export -f funcImageToggle
echo 0 > TOGGLE; funcImageToggle
export MAIN_DIALOG='
<window title="btnImageToggle" resizable="false" width-request="300" height-request="100">
<vbox homogeneous="true">
<hbox homogeneous="true">
<pixmap>
<variable>TOGGLEPIX</variable>
<input file>toggle.png</input>
</pixmap>
<button>
<variable>TOGGLEME</variable>
<input file>toggle.png</input>
<label>"Toggle Me!"</label>
<action>funcImageToggle</action>
<action type="refresh">TOGGLEME</action>
<action type="refresh">TOGGLEMETOO</action>
<action type="refresh">TOGGLEPIX</action>
</button>
<button tooltip-text="Toggle me too!">
<variable>TOGGLEMETOO</variable>
<input file>toggle.png</input>
<action>funcImageToggle</action>
<action type="refresh">TOGGLEMETOO</action>
<action type="refresh">TOGGLEME</action>
</button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
gtkdialog4 --center --program=MAIN_DIALOG
Code: Select all
patch -p0 < gtkdialog_moose_thunor_pixmap.patch
Code: Select all
<pixmap>
<variable>ARTWORK</variable>
<input file>$HOME/.pmusic/nowplaying_albumart.jpg</input>
<width>100</width>
</pixmap>
Code: Select all
<button relief="2" width-request="100">
<variable>ARTWORK</variable>
<input file>$HOME/.pmusic/nowplaying_albumart.jpg</input>
</button>