01.03-button_signals 

01.03-button_signals.png

Example 7. File 01.03-button_signals

#! /bin/bash

#
# Some action types are still missing. See execute_action() for more
# information.
#

export MAIN_DIALOG='
 <vbox>
  <frame Button signals>
    <hbox>
      <button>
        <label>All Default</label>
      </button>
      <button>
        <label>Enter/Leave/Clicked</label>
        <action signal="clicked">echo Signal: clicked /default/</action>
        <action signal="enter">echo Signal: enter</action>
        <action signal="leave">echo Signal: leave</action>
      </button>
      <button>
        <label>Pressed/Released/Clicked</label>
        <action signal="clicked">echo Signal: clicked /default/</action>
        <action signal="pressed">echo Signal: pressed</action>
        <action signal="released">echo Signal: released</action>
      </button>
    </hbox>
  </frame>
  <hbox>
   <button cancel>
     <action signal="enter">echo Do you really want to exit?</action>
     <action type="exit">Cancel</action>
   </button>
   <button ok>
     <action signal="enter">echo Do you really want to exit?</action>
     <action type="exit">OK</action>
   </button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG