
Example 6. File 01.02-button_action_types
#! /bin/bash
#
# Some action types are still missing. See execute_action() for more
# information.
#
export DIALOG='
<vbox>
<text>
<label>This is an other dialog window.</label>
</text>
<button>
<label>Close</label>
<action type="closewindow">DIALOG</action>
</button>
</vbox>
'
export MAIN_DIALOG='
<vbox>
<frame Widgets>
<checkbox>
<label>This is a checkbox</label>
<variable>CHECKBOX</variable>
</checkbox>
<entry>
<input>date</input>
<variable>ENTRY</variable>
</entry>
</frame>
<frame Button actions>
<hbox>
<button>
<label>exit</label>
<action>echo You pressed the exit button</action>
<action type="exit">Exit by button</action>
</button>
</hbox>
<hbox>
<button>
<label>launch</label>
<action type="launch">DIALOG</action>
</button>
<button>
<label>closewindow</label>
<action type="closewindow">DIALOG</action>
</button>
</hbox>
<hbox>
<button>
<label>enable</label>
<action type="enable">ENTRY</action>
<action type="enable">CHECKBOX</action>
</button>
<button>
<label>disable</label>
<action type="disable">ENTRY</action>
<action type="disable">CHECKBOX</action>
</button>
</hbox>
<hbox>
<button>
<label>refresh</label>
<action type="refresh">ENTRY</action>
</button>
<button>
<label>clear</label>
<action type="clear">ENTRY</action>
</button>
<button>
<label>fileselect</label>
<action type="fileselect">ENTRY</action>
</button>
</hbox>
</frame>
<hbox>
<button ok></button>
<button cancel></button>
</hbox>
</vbox>
'
gtkdialog --program=MAIN_DIALOG