It's an entry widget with a checkbox widget. The entry widget is to enter a password. The checkbox widget should show the password when true and hide it when false.
Code: Select all
#!/bin/sh
[ -z $GTKDIALOG ] && GTKDIALOG=gtkdialog
MAIN_DIALOG='
<window>
<vbox>
<frame Not Working>
<entry visibility="$CHECKBOX">
<default>Password</default>
<variable>ENTRY</variable>
</entry>
<checkbox>
<label>Show/Hide Password</label>
<variable>CHECKBOX</variable>
<action>echo $CHECKBOX</action>
<action>if true enable:ENTRY</action>
<action>if false disable:ENTRY</action>
<action>refresh:ENTRY</action>
</checkbox>
</frame>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
</window>
'
export MAIN_DIALOG
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac
I am also echoing the $CHECKBOX variable to make sure it's changing state which it is.
How do I make the tag attribute visibility="$CHECKBOX" update when the checkbox state is changed. I am refreshing the ENTRY widget but that's not doing it.
It's looks simple enough but it's got me stumped.
Thanks.