#! /bin/bash
export pfilesearch_splash='
<window title="pFilesearch" icon-name="gtk-find">
<vbox>
 <frame>
  <pixmap icon_size="6"><input file stock="gtk-find"></input></pixmap>
  <text use-markup="true"><label>"<b>pFilesearch</b>"</label></text>
  <text use-markup="true"><label>"'"$(<$WORKDIR/pfilesearch-splashtext)"'"</label></text>
  <progressbar>
   <label>Sigmund Berglund,   GPL 2007-2015</label>
   <input>while [ "$I" != "100" ]; do I=`cat '"$WORKDIR"'/pfilesearch-splash`; echo $I; sleep 0.5; done</input>
   <action type="exit">Ready</action>
  </progressbar>
 </frame>
 <hbox>
  <button cancel>
   <input file stock="gtk-cancel"></input>
   <action>EXIT:stop</action>
  </button> 
 </hbox>
</vbox></window>
'
I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog -p pfilesearch_splash --center); do
	eval $STATEMENTS
done

if [ "$EXIT" = "stop" ]; then
	IFS=$'\n'
	TMP="`ps -eo pid,command`"
	for I in "`echo "$TMP" | grep -i find | grep -vi pfind | awk '{print $1}'`"; do kill -9 $I; done
fi