I need to modify image on the fly
I do not know if <pixmap> accepts drag and drop image
(it's possible?)
I did this:
I added a text box by dragging the path of the image (dragdrop)
to modify the path of the image but I can not make it work
same, I want to clean the text box after the refresh of the image
I attach the code
Code: Select all
#! /bin/bash
# name image reference gtk-change-fly-image.jpg
echo "gtk-change-fly-image.jpg">/tmp/image
export TMPDIR=`cat /tmp/image`
repix() {
export TMPDIR=`cat /tmp/image`
Xdialog --msg $TMPDIR x
}
function repix2() {
export TMPDIR=`cat /tmp/image`
echo -e '<pixmap>
<variable>IMAGE1</variable>
<action>repix</action>
<input file>'"$TMPDIR"'</input>
<action>refresh:IMAGEN1</action>
</pixmap> '
}
export -f repix
export IMAGE="gtk-dialog-folgers.jpg"
export MAIN_DIALOG='
<vbox>
<frame Changue image on fly-drag-drop path>
<eventbox>
<vbox>
'"$(repix2)"'
<text label="Drop path image here.." wrap="false"></text>
<entry file-monitor="true" auto-refresh="true">
<variable>ENTRY</variable>
<action when="selection-changed">echo -e "$ENTRY"</action>
<action when="selection-changed">echo "$ENTRY">/tmp/image</action>
<action when="selection-changed">refresh:IMAGE1</action>
<action when="selection-changed">ENTRY=`echo ""` </action>
<action when="selection-changed">refresh:ENTRY</action>
</entry>
</vbox>
</eventbox>
</frame>
<hbox>
<button cancel></button>
<button label="Refresh pix 2 & clear texbox">
<action>repix</action>
<action>ENTRY=`echo ""`</action>
<action>repix2()</action>
<action>refresh:ENTRY</action>
</button>
<button ok></button>
</hbox>
</vbox>
'
gtkdialog --program=MAIN_DIALOG