Code: Select all
[ -z $(which blabla) ] && export SMODE=false || export SMODE=true
Code: Select all
<sensitive>'$SMODE'</sensitive>
------------------------------------------------------------------------
Hi all, trying to disable a variable "BLAOPTS" with togglebutton uncollapsed as well as collapsed (at start of script).
With setting EXTRA=false (as below, uncollapsed) it works OK, but I'd like it to work also when you set EXTRA=true (collapsed)
Code: Select all
export EXTRA=false
[ -z $(which flac) ] && export FLAC=1
# obviously "blabla" is not in PATH
[ -z $(which blabla) ] && export BLA=1
export MAIN='
<window title="Toggle button example" resizable="false">
<vbox>
<vbox visible="'$EXTRA'">
<hbox space-expand="true" space-fill="true">
<text><label>Flac options:</label></text>
<combobox>
<variable>FLACOPTS</variable>
<item>--compression-level-5</item>
<item>--compression-level-1</item>
</combobox>
</hbox>
<hbox space-expand="true" space-fill="true">
<text><label> BLA options:</label></text>
<combobox>
<variable>BLAOPTS</variable>
<item>-c2000</item>
<item>-c1000</item>
</combobox>
</hbox>
<variable>varTOGGLE</variable>
</vbox>
<vbox>
<hbox>
<togglebutton>
<label>"Options"</label>
<default>'$EXTRA'</default>
<variable>EXTRA</variable>
<action>if true show:varTOGGLE</action>
<action>if false hide:varTOGGLE</action>
<action condition="command_is_true( echo $FLAC )">disable:FLACOPTS</action>
<action condition="command_is_true( echo $BLA )">disable:BLAOPTS</action>
</togglebutton>
<button>
<label>'Quit'</label>
<input file stock="gtk-quit"></input>
<action type="exit">exit</action>
</button>
</hbox>
</vbox>
</vbox>
</window>'
gtkdialog --program=MAIN --center
Fred