Code: Select all
<action signal=\"button-release-event\">[ \$nTabPage -eq 0 ] && xmessage \"first tab\"</action>
Code: Select all
<action signal=\"button-release-event\">[ \$nTabPage -eq 0 ] && xmessage \"first tab\"</action>
Code: Select all
<vbox>
<button>....</button>
...
...
<text space-expand="true"><label>""</label></text>
<button>...</button>
</vbox>
Code: Select all
#! /bin/bash
######################## EXPORT Variablen ##############################
export cTabBlank
export cTabPage1
export cTabPage2
export cTabPage3
#typeset -i nTabPage=0
#declare -i nTabPage=1
######################## EXPORT Functions ##############################
function GetTabPage1()
{
cTabPage1="<frame>
<text>
<label>\"first tab\"</label>
</text>
</frame>"
echo $cTabPage1
}
export -f GetTabPage1
#########################################################################
function GetTabPage2()
{
cTabPage2="<frame>
<text>
<label>\"second tab\"</label>
</text>
</frame>"
echo $cTabPage2
}
export -f GetTabPage2
#########################################################################
function GetTabPage3()
{
cTabPage3="<frame>
<text>
<label>\"third tab\"</label>
</text>
</frame>"
echo $cTabPage3
}
export -f GetTabPage3
#########################################################################
function GetTabBlank()
{
cTabBlank="<frame>
<text>
<label>\"blank tab\"</label>
</text>
</frame>"
echo $cTabBlank
}
export -f GetTabBlank
#########################################################################
function OnTabPageChanged()
{
declare -i local nActPage
nActPage=$1
if [ $nActPage -eq 0 ]; then
xmessage "content of tab one is allways the same, no changes needed"
#cTabPage1=$(GetTabPage1)
elif [ $nActPage -eq 1 ]; then
xmessage "content of tab two should change by changing variable cTabPage2"
cTabPage2=$(GetTabPage2)
elif [ $nActPage -eq 2 ]; then
xmessage "content of tab three should change by changing variable cTabPage3"
cTabPage3=$(GetTabPage3)
fi
}
export -f OnTabPageChanged
#################### INIT Notebook Tabs ################################
cTabPage1=$(GetTabPage1)
cTabPage2=$(GetTabBlank)
cTabPage3=$(GetTabBlank)
############################# M A I N ##################################
export MAIN="
<notebook>
$cTabPage1
$cTabPage2
$cTabPage3
<variable>nTabPage</variable>
<action signal=\"button-release-event\">[ "'$nTabPage'" -eq 0 ] && OnTabPageChanged "'$nTabPage'" && refresh:nTabPage</action>
<action signal=\"button-release-event\">[ "'$nTabPage'" -eq 1 ] && OnTabPageChanged "'$nTabPage'" && refresh:nTabPage</action>
<action signal=\"button-release-event\">[ "'$nTabPage'" -eq 2 ] && OnTabPageChanged "'$nTabPage'" && refresh:nTabPage</action>
</notebook>"
############################# T E S T ##################################
#I=$IFS; IFS=""
#for STATEMENTS in $(gtkdialog -cp MAIN ); do
# eval $STATEMENTS
#done
#IFS=$I
gtkdialog -cp MAIN
##################### UNSET Functions ################################
unset GetTabBlank
unset GetTabPage1
unset GetTabPage2
unset GetTabPage3
unset OnTabPageChanged
##################### UNSET Variablen ################################
unset cTabBlank
unset cTabPage1
unset cTabPage2
unset cTabPage3
Code: Select all
#!/bin/bash
ln -fs ad1.png ad.png
echo 2 > /tmp/count
function cycle_ad {
# Because gtkdialog won't handle global vars for some retarded reason!
i=`cat /tmp/count`
if [ -e "ad$i.png" ]; then
ln -fs ad$i.png ad.png
echo $i+1|bc > /tmp/count
else
ln -fs ad1.png ad.png
echo 2 > /tmp/count
fi
}
export MAIN='
<window width-request="600" height-request="400">
<vbox homogeneous="true">
<pixmap>
<variable>IMAGE</variable>
<input file>ad.png</input>
</pixmap>
<timer milliseconds="false" interval="13" visible="false">
<action>exec $SHELL -c cycle_ad</action>
<action>sleep 2</action>
<action type="refresh">IMAGE</action>
</timer>
</vbox>
</window>'
export -f cycle_ad
gtkdialog --center --program=MAIN
Code: Select all
<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:12</Option>
</Group>
So, depending on the JWM version you are running:JWM Configuration web page wrote:layer
The layer of the tray. The default is above. Valid values are below, normal, and above.
Code: Select all
<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:12</Option>
</Group>
Code: Select all
<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:above</Option>
</Group>
Zigbert provides a code snippet on the first page of this thread ("The next script shows how to move items in list by drag'n drop"). Not really buttons and I haven't tested, but maybe a start.puppy_apprentice wrote:I want to make buttons UP and DOWN to move item on the list/tree gadget one place up or down. Is there built-in function for this task or i will have make own bash function for this? Maybe someone has code snippet for this?
Code: Select all
<button tooltip-text=\" $(gettext 'Move item UP') \">
<variable>MOVE_UP</variable>
<input file stock=\"gtk-go-up\"></input>
<visible>$VISIBLE_MOVE_UPDOWN</visible>
<action>DIRECTION=up; . $APPDIR/func -move_up_down; . $APPDIR/func -info_burn</action>
<action>refresh:BURNLIST</action>
</button>
Code: Select all
<action signal="button-press-event">grep -F "$PLAYLIST" '$WORKDIR'/playlist > '$WORKDIR'/PLAYLIST_PRESS_EVENT; [ "$PLAYLIST" ] && . '$APPDIR'/menu_playqueue</action>
<action signal="button-release-event">. '$APPDIR'/func -playlist_move</action> ##this will play the track as well
<action signal="button-release-event">refresh:PLAYLIST</action>