"Fossies" - the Fresh Open Source Software Archive

Member "gtkdialog-0.8.3/examples/button/button_action_functions" (6 Jan 2013, 1941 Bytes) of package /linux/privat/old/gtkdialog-0.8.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 #
    4 # Some action function types are still missing.
    5 # See execute_action() for more information.
    6 #
    7 
    8 GTKDIALOG=gtkdialog
    9 
   10 DIALOG='
   11 <window>
   12     <vbox>
   13         <text>
   14             <label>This is another dialog window.</label>
   15         </text>
   16         <button>
   17             <label>Close</label>
   18             <action function="closewindow">DIALOG</action>
   19         </button>
   20     </vbox>
   21     <variable>DIALOG</variable>
   22 </window>
   23 '
   24 export DIALOG
   25 
   26 MAIN_DIALOG='
   27 <window>
   28     <vbox>
   29         <frame Widgets>
   30             <checkbox>
   31                 <label>This is a checkbox</label>
   32                 <variable>CHECKBOX</variable>
   33             </checkbox>
   34             <entry>
   35                 <input>date</input>
   36                 <variable>ENTRY</variable>
   37             </entry>
   38         </frame>
   39         <frame Button actions>
   40             <hbox>
   41                 <button>
   42                     <label>exit</label>
   43                     <action>echo You pressed the exit button</action>
   44                     <action function="exit">Exit by button</action>
   45                 </button>
   46             </hbox>
   47             <hbox>
   48                 <button>
   49                     <label>launch</label>
   50                     <action function="launch">DIALOG</action>
   51                 </button>
   52                 <button>
   53                     <label>closewindow</label>
   54                     <action function="closewindow">DIALOG</action>
   55                 </button>
   56             </hbox>
   57             <hbox>
   58                 <button>
   59                     <label>enable</label>
   60                     <action function="enable">ENTRY</action>
   61                     <action function="enable">CHECKBOX</action>
   62                 </button>
   63                 <button>
   64                     <label>disable</label>
   65                     <action function="disable">ENTRY</action>
   66                     <action function="disable">CHECKBOX</action>
   67                 </button>
   68             </hbox>
   69             <hbox>
   70                 <button>
   71                     <label>refresh</label>
   72                     <action function="refresh">ENTRY</action>
   73                 </button>
   74                 <button>
   75                     <label>clear</label>
   76                     <action function="clear">ENTRY</action>
   77                 </button>
   78                 <button>
   79                     <label>fileselect</label>
   80                     <action function="fileselect">ENTRY</action>
   81                 </button>
   82             </hbox>
   83         </frame>
   84         <hbox>
   85             <button ok></button>
   86             <button cancel></button>
   87         </hbox>
   88     </vbox>
   89 </window>
   90 '
   91 export MAIN_DIALOG
   92 
   93 case $1 in
   94     -d | --dump) echo "$DIALOG" "$MAIN_DIALOG" ;;
   95     *) $GTKDIALOG --program=MAIN_DIALOG ;;
   96 esac