03.00-checkbox 

03.00-checkbox.png

Example 12. File 03.00-checkbox

#! /bin/bash

export MAIN_DIALOG='
 <vbox>
  <frame Checkbox example>
    <checkbox>
      <label>This is a checkbox...</label>
      <variable>CHECKBOX</variable>
      <action>echo Checkbox is $CHECKBOX now.</action>
      <action>if true enable:ENTRY</action>
      <action>if false disable:ENTRY</action>
    </checkbox>
    <entry>
      <default>Text in the entry</default>
      <variable>ENTRY</variable>
      <visible>disabled</visible>
    </entry>
    <checkbox>
      <label>I want an OK button NOW!</label>
      <default>true</default>
      <variable>ANOTHER_CHECKBOX</variable>
      <action>if true enable:OKBUTTON</action>
      <action>if false disable:OKBUTTON</action>
    </checkbox>
  </frame>
  <hbox>
   <button ok>
     <variable>OKBUTTON</variable>
   </button>
   <button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG