I am trying to put together a image viewer that I can change images with the next button instead of using the menubar to change the images. Any help would be great.
Code: Select all
#! /bin/bash
#Copyright 2013 GPL
#Bible Time Line - author - oldyeller
if [ "`which gtkdialog4`" ]; then
GTKDIALOG=gtkdialog4
elif [ "`which gtkdialog3`" ]; then
GTKDIALOG=gtkdialog3
else
GTKDIALOG=gtkdialog
fi
WORKDIR="/usr/local/Manna/timeline"
TL_DIR="$WORKDIR/btl"
export MAIN_DIALOG='
<window title="Bible TimeLine viewer" icon-name="Com" skip-taskbar-hint="false">
<vbox>
<menubar>
<menu label="Timeline" use-underline="true">
<menuitem stock-id="gtk-open" label="1">
<action>cat '$TL_DIR'/timeline1.jpg > '$TL_DIR'.jpg</action>
<action>refresh:IMAGE</action>
</menuitem>
<menuitem stock-id="gtk-open" label="2">
<action>cat '$TL_DIR'/timelinetemplete.jpg > '$TL_DIR'.jpg</action>
<action>refresh:IMAGE</action>
</menuitem>
<menuitem stock-id="gtk-open" label="3">
<action>cat '$TL_DIR'/Mannagreen.jpg > '$TL_DIR'.jpg</action>
<action>refresh:IMAGE</action>
</menuitem>
<menuitem stock-id="gtk-open" label="4">
<action>cat '$TL_DIR'/Ocean-Sunset.jpg > '$TL_DIR'.jpg</action>
<action>refresh:IMAGE</action>
</menuitem>
<menuitem stock-id="gtk-open" label="5">
<action>cat '$TL_DIR'/Mannared.jpg > '$TL_DIR'.jpg</action>
<action>refresh:IMAGE</action>
</menuitem>
</menu>
</menubar>
<vbox scrollable="true" width="700" height="500" space-expand="true" space-fill="true">
<pixmap>
<variable>IMAGE</variable>
<input file>'$TL_DIR'.jpg</input>
</pixmap>
</vbox>
<hbox>
<button>
<label>NEXT</label>
<variable>NEXT</variable>
<action>cat '$TL_DIR'/timelinetemplete.jpg > '$TL_DIR'.jpg</action>
<action>refresh:IMAGE</action>
</button>
</hbox>
</vbox>
<action signal="hide">exit:Exit</action>
</window>
'
$GTKDIALOG --center --program=MAIN_DIALOG