#! /bin/bash export MAIN_DIALOG=' <vbox> <text> <label>This is a static text.</label> </text> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <text> <label>This is a static text.</label> </text> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <text use-markup="true"> <label>"<b>use-markup</b>, which is cool."</label> </text> <text wrap="true" width-chars="10"> <label>wrap: wrap lines if the text becomes too wide, which is also cool!</label> </text> <text selectable="true"> <label>selectable text, also cool</label> </text> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Label from file> <text> <label>This is a static text.</label> <input file>/etc/hosts.allow</input> </text> </frame> <frame Label from command> <text> <label>This is a static text.</label> <input>date</input> <variable>DATE</variable> </text> <hbox> <button> <label>refresh</label> <action type="refresh">DATE</action> </button> </hbox> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <button> <label>Label</label> <action>echo You pressed the button with the label.</action> </button> <button> <input file>fileopen.xpm</input> <action>echo You pressed the button with the pixmap.</action> </button> </hbox> <hbox> <button yes> <action>echo You pressed the Yes button.</action> </button> <button no> <action>echo You pressed the No button.</action> </button> </hbox> <hbox> <button ok> <action>echo You pressed the OK button.</action> </button> <button cancel> <action>echo You pressed the Cancel button.</action> </button> <button help> <action>echo You pressed the Help button.</action> </button> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <button sensitive="false"> <label>Label</label> <action>echo You pressed the button with the label.</action> </button> <button sensitive="false"> <input file>fileopen.xpm</input> <action>echo You pressed the button with the pixmap.</action> </button> </hbox> <hbox> <button yes> <action>echo You pressed the Yes button.</action> </button> <button no> <action>echo You pressed the No button.</action> </button> </hbox> <hbox> <button ok> <action>echo You pressed the OK button.</action> </button> <button cancel> <action>echo You pressed the Cancel button.</action> </button> <button help> <action>echo You pressed the Help button.</action> </button> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /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
#! /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
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <button> <input file icon="about_kde"></input> <action>echo about_kde</action> </button> <button> <input file icon="attach"></input> <action>echo attach</action> </button> <button> <input file icon="back"></input> <action>echo back</action> </button> <button> <input file icon="bookmark_add"></input> <action>echo bookmark_add</action> </button> <button> <input file icon="bookmark"></input> <action>echo bookmark</action> </button> <button> <input file icon="bottom"></input> <action>echo bottom</action> </button> <button> <input file icon="button_cancel"></input> <action>echo button_cancel</action> </button> <button> <input file icon="button_ok"></input> <action>echo button_ok</action> </button> <button> <input file icon="cd"></input> <action>echo cd</action> </button> <button> <input file icon="colorpicker"></input> <action>echo colorpicker</action> </button> <button> <input file icon="configure"></input> <action>echo configure</action> </button> <button> <input file icon="configure_shortcuts"></input> <action>echo configure_shortcuts</action> </button> <button> <input file icon="configure_toolbars"></input> <action>echo configure_toolbars</action> </button> <button> <input file icon="connect_established"></input> <action>echo connect_established</action> </button> <button> <input file icon="connect_no"></input> <action>echo connect_no</action> </button> <button> <input file icon="contents2"></input> <action>echo contents2</action> </button> <button> <input file icon="contents"></input> <action>echo contents</action> </button> <button> <input file icon="down"></input> <action>echo down</action> </button> <button> <input file icon="edit_add"></input> <action>echo edit_add</action> </button> <button> <input file icon="editcopy"></input> <action>echo editcopy</action> </button> <button> <input file icon="editcut"></input> <action>echo editcut</action> </button> <button> <input file icon="editdelete"></input> <action>echo editdelete</action> </button> <button> <input file icon="editpaste"></input> <action>echo editpaste</action> </button> <button> <input file icon="edit"></input> <action>echo edit</action> </button> </hbox> <hbox> <button> <input file icon="edit_remove"></input> <action>echo edit_remove</action> </button> <button> <input file icon="edittrash"></input> <action>echo edittrash</action> </button> <button> <input file icon="exec"></input> <action>echo exec</action> </button> <button> <input file icon="exit"></input> <action>echo exit</action> </button> <button> <input file icon="fileexport"></input> <action>echo fileexport</action> </button> <button> <input file icon="filefind"></input> <action>echo filefind</action> </button> <button> <input file icon="fileimport"></input> <action>echo fileimport</action> </button> <button> <input file icon="filenew"></input> <action>echo filenew</action> </button> <button> <input file icon="fileopen"></input> <action>echo fileopen</action> </button> <button> <input file icon="fileprint"></input> <action>echo fileprint</action> </button> <button> <input file icon="filequickprint"></input> <action>echo filequickprint</action> </button> <button> <input file icon="filesaveas"></input> <action>echo filesaveas</action> </button> <button> <input file icon="filesave"></input> <action>echo filesave</action> </button> <button> <input file icon="finish"></input> <action>echo finish</action> </button> <button> <input file icon="forward"></input> <action>echo forward</action> </button> <button> <input file icon="frameprint"></input> <action>echo frameprint</action> </button> <button> <input file icon="gohome"></input> <action>echo gohome</action> </button> <button> <input file icon="goto"></input> <action>echo goto</action> </button> <button> <input file icon="help"></input> <action>echo help</action> </button> <button> <input file icon="history"></input> <action>echo history</action> </button> <button> <input file icon="khtml_kget"></input> <action>echo khtml_kget</action> </button> <button> <input file icon="locationbar_erase"></input> <action>echo locationbar_erase</action> </button> <button> <input file icon="lock"></input> <action>echo lock</action> </button> <button> <input file icon="player-eject"></input> <action>echo player-eject</action> </button> </hbox> <hbox> <button> <input file icon="player_end"></input> <action>echo player_end</action> </button> <button> <input file icon="player-fwd"></input> <action>echo player-fwd</action> </button> <button> <input file icon="player_pause"></input> <action>echo player_pause</action> </button> <button> <input file icon="player_play"></input> <action>echo player_play</action> </button> <button> <input file icon="player_rew"></input> <action>echo player_rew</action> </button> <button> <input file icon="player_start"></input> <action>echo player_start</action> </button> <button> <input file icon="player_stop"></input> <action>echo player_stop</action> </button> <button> <input file icon="redo"></input> <action>echo redo</action> </button> <button> <input file icon="reload"></input> <action>echo reload</action> </button> <button> <input file icon="run"></input> <action>echo run</action> </button> <button> <input file icon="spellcheck"></input> <action>echo spellcheck</action> </button> <button> <input file icon="start"></input> <action>echo start</action> </button> <button> <input file icon="stop"></input> <action>echo stop</action> </button> <button> <input file icon="text_block"></input> <action>echo text_block</action> </button> <button> <input file icon="text_bold"></input> <action>echo text_bold</action> </button> <button> <input file icon="text_center"></input> <action>echo text_center</action> </button> <button> <input file icon="text_italic"></input> <action>echo text_italic</action> </button> <button> <input file icon="text-left"></input> <action>echo text-left</action> </button> <button> <input file icon="text_right"></input> <action>echo text_right</action> </button> <button> <input file icon="text_strike"></input> <action>echo text_strike</action> </button> <button> <input file icon="text_under"></input> <action>echo text_under</action> </button> <button> <input file icon="top"></input> <action>echo top</action> </button> <button> <input file icon="undo"></input> <action>echo undo</action> </button> <button> <input file icon="up"></input> <action>echo up</action> </button> </hbox> <hbox> <button> <input file icon="viewmag1"></input> <action>echo viewmag1</action> </button> <button> <input file icon="viewmagfit"></input> <action>echo viewmagfit</action> </button> <button> <input file icon="viewmag-"></input> <action>echo viewmag-</action> </button> <button> <input file icon="viewmag+"></input> <action>echo viewmag+</action> </button> <button> <input file icon="window_fullscreen"></input> <action>echo window_fullscreen</action> </button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <entry> <default>Default value</default> <variable>ENTRY</variable> </entry> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <text> <label>activates_default:</label> </text> <entry activates_default="true"> <default>Default value</default> <variable>ENTRY1</variable> </entry> </hbox> <hbox> <text> <label>editable:</label> </text> <entry editable="false"> <default>Default value</default> <variable>ENTRY2</variable> </entry> </hbox> <hbox> <text> <label>has_frame:</label> </text> <entry has_frame="false"> <default>Default value</default> <variable>ENTRY3</variable> </entry> </hbox> <hbox> <text> <label>invisible_char:</label> </text> <entry invisible_char="x" visibility="false"> <default>Default value</default> <variable>ENTRY4</variable> </entry> </hbox> <hbox> <text> <label>max_length:</label> </text> <entry max_length="5"> <default>Default value</default> <variable>ENTRY5</variable> </entry> </hbox> <hbox> <text> <label>width_chars:</label> </text> <entry width_chars="35"> <default>Default value</default> <variable>ENTRY6</variable> </entry> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <entry> <input>whoami</input> <variable>ENTRY</variable> </entry> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /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
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Checkbox attributes example> <checkbox active="true"> <label>Checkbox with active set to true</label> <variable>CHECKBOX1</variable> <action>echo Checkbox is $CHECKBOX1 now.</action> </checkbox> <checkbox draw_indicator="false"> <label>Checkbox with draw_indicator set to false</label> <variable>CHECKBOX2</variable> <action>echo Checkbox is $CHECKBOX2 now.</action> </checkbox> <checkbox inconsistent="true"> <label>Checkbox with inconsistent set to true</label> <variable>CHECKBOX3</variable> <action>echo Checkbox is $CHECKBOX3 now.</action> </checkbox> </frame> <hbox> <button ok> <variable>OKBUTTON</variable> </button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Radiobutton attributes example> <radiobutton active="true"> <label>Radiobutton with active set to true</label> <variable>RADIOBUTTON1</variable> <action>echo Radiobutton is $RADIOBUTTON1 now.</action> </radiobutton> <radiobutton draw_indicator="false"> <label>Radiobutton with draw_indicator set to false</label> <variable>RADIOBUTTON2</variable> <action>echo Radiobutton is $RADIOBUTTON2 now.</action> </radiobutton> <radiobutton inconsistent="true"> <label>Radiobutton with inconsistent set to true</label> <variable>RADIOBUTTON3</variable> <action>echo Radiobutton is $RADIOBUTTON3 now.</action> </radiobutton> </frame> <hbox> <button ok> <variable>OKBUTTON</variable> </button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <text> <label>Combobox:</label> </text> <combobox> <variable>COMBOBOX</variable> <item>First item</item> <item>Second item</item> <item>Third item</item> </combobox> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Progress> <text> <label>Some text describing what is happening.</label> </text> <progressbar> <label>Some Text</label> <input>for i in $(seq 0 10 100); do echo $i; sleep 0.3; done</input> <action type="exit">Ready</action> </progressbar> </frame> <hbox> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <text> <label>value-in-list:</label> </text> <combobox case-sensitive="false" value-in-list="true"> <variable>COMBOBOX1</variable> <item>First</item> <item>Second</item> <item>Third</item> </combobox> </hbox> <hbox> <text> <label>allow-empty:</label> </text> <combobox allow-empty="false" value-in-list="true"> <variable>COMBOBOX2</variable> <item>First</item> <item>Second</item> <item>Third</item> </combobox> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /usr/bin/gtkdialog -e function progress() { for i in $(seq 0 10 100); do echo $i [ "$i" -le 30 ] && echo "Start..." [ "$i" -le 60 -a "$i" -gt 30 ] && echo "Middle..." [ "$i" -gt 60 ] && echo "End..." sleep 0.3 done; echo ready } export MAIN_DIALOG=' <hbox> <button cancel> </button> <button> <label>Launch</label> <action type="launch">BAR_DIALOG</action> </button> </hbox> ' export BAR_DIALOG=' <vbox> <frame Progress> <text> <label>Some text describing what is happening.</label> </text> <progressbar> <label>Some Text</label> <input>progress</input> <action type="closewindow">Ready</action> </progressbar> </frame> <hbox> <button cancel> <action type="closewindow">BAR_DIALOG</action> </button> </hbox> </vbox> '
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <text> <label>Combobox:</label> </text> <combobox> <variable>COMBOBOX</variable> <input>ls</input> </combobox> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /usr/bin/gtkdialog -e function progress() { for i in $(seq 0 10 100); do echo $i [ "$i" -le 30 ] && echo "Start..." [ "$i" -le 60 -a "$i" -gt 30 ] && echo "Middle..." [ "$i" -gt 60 ] && echo "End..." sleep 0.3 done; echo ready } function progress_fast() { for i in $(seq 0 1 10000); do echo $((i/100)) [ "$i" -le 3000 ] && echo "Start..." [ "$i" -le 6000 -a "$i" -gt 3000 ] && echo "Middle..." [ "$i" -gt 6000 ] && echo "End..." #sleep 0.1 done; echo ready } export MAIN_DIALOG=' <vbox> <entry> <variable>ENTRY</variable> <input>date</input> </entry> <hbox> <button cancel> </button> <button> <label>Launch</label> <action type="launch">BAR_DIALOG</action> </button> <button> <label>Close</label> <action type="exit">CLOSE</action> </button> </hbox> </vbox> ' export BAR_DIALOG=' <vbox> <frame Progress> <text> <label>Some text describing what is happening.</label> </text> <progressbar> <variable>PROGRESS_BAR</variable> <label>Some Text</label> <input>progress_fast</input> <action type="refresh">ENTRY</action> <action type="closewindow">BAR_DIALOG</action> <action>echo ready</action> </progressbar> </frame> <hbox> <button cancel> <action type="closewindow">BAR_DIALOG</action> </button> </hbox> </vbox> '
#! /bin/bash export MAIN_DIALOG=' <vbox> <edit> <variable>EDITOR</variable> <width>350</width><height>150</height> <default> "This is the default text of the editor." </default> </edit> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Pixmap from Stock> <pixmap icon_size="6"> <input file stock="gtk-info"></input> </pixmap> </frame> <frame Pixmap from File> <pixmap> <input file>gvim.png</input> </pixmap> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <edit editable="false"> <variable>EDITOR2</variable> <width>350</width><height>50</height> <default>editable is false</default> </edit> <edit accepts-tab="false"> <variable>EDITOR1</variable> <width>350</width><height>50</height> <default>accepts-tab is false</default> </edit> <edit indent="25"> <variable>EDITOR2</variable> <width>350</width><height>50</height> <default>indent is 25</default> </edit> <edit left-margin="25" right-margin="25"> <variable>EDITOR2</variable> <width>350</width><height>50</height> <default>left-margin and right-margin is 25</default> </edit> <edit cursor-visible="false"> <variable>EDITOR2</variable> <width>350</width><height>50</height> <default>cursor-visible is false</default> </edit> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <list> <variable>LIST</variable> <item>First item</item> <item>Second item</item> <item>Third item</item> </list> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <list selection-mode="3"> <variable>LIST</variable> <item>First item</item> <item>Second item</item> <item>Third item</item> </list> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <list> <variable>LIST</variable> <item>First item</item> <item>Second item</item> <item>Third item</item> <action>echo Chosen item is $LIST</action> </list> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <table> <width>500</width><height>200</height> <variable>TABLE</variable> <label>Header of Column 1|Header of Column 2|Header of Column 3</label> <item>First item |Row 1 Column 2 |Row 1 Column 3</item> <item>Second item|Row 2 Column 2 |Row 2 Column 3</item> <item>Third item |Row 3 Column 2 |Row 3 Column 3</item> <action>echo $TABLE</action> </table> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash # # stock_column # icon_column # export MAIN_DIALOG=' <vbox> <tree stock="gtk-file"> <label>Permissions|Filename</label> <input>./list.sh</input> <height>100</height><width>400</width> <variable>TREE1</variable> </tree> <tree stock="gtk-file"> <label>Permissions|Filename</label> <input icon_column="0">./list.sh</input> <height>100</height><width>400</width> <variable>TREE1</variable> </tree> <tree> <label>Device | Directory | File</label> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.tex</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.dvi</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.ps</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.pdf</item> <item stock="gtk-cdrom">CD_ROM Drive | /cdrom/ | </item> <height>100</height><width>400</width> <variable>TREE2</variable> </tree> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' GTKDIALOG=gtkdialog if [ -x "$HOME/bin/gtkdialog" ]; then GTKDIALOG="$HOME/bin/gtkdialog" fi $GTKDIALOG --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame With Rules, Without Headers> <tree rules_hint="true" headers_visible="false"> <input file>tmp.text</input> <label>Device | Directory | File</label> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.tex</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.dvi</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.ps</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.pdf</item> <item stock="gtk-cdrom">CD_ROM Drive | /cdrom/ | </item> <height>100</height><width>400</width> <variable>TREE</variable> </tree> </frame> <frame Hover Mode> <tree hover_expand="true" hover_selection="true"> <input file>tmp.text</input> <label>Device | Directory | File</label> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.tex</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.dvi</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.ps</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.pdf</item> <item stock="gtk-cdrom">CD_ROM Drive | /cdrom/ | </item> <height>100</height><width>400</width> <variable>TREE</variable> </tree> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash # # The <item> tag can hold the following attributes: # o stock or stock_id # o icon or icon_name # export MAIN_DIALOG=' <vbox> <tree> <input file>tmp.text</input> <label>Device | Directory | File</label> <item stock_id="gtk-floppy">Floppy Disk | /floppy/ | ak.tex</item> <item stock="gtk-floppy">Floppy Disk | /floppy/ | ak.dvi</item> <item icon="pdf">Floppy Disk | /floppy/ | ak.ps</item> <item icon_name="rpm">Floppy Disk | /floppy/ | ak.pdf</item> <item stock="gtk-cdrom">CD_ROM Drive | /cdrom/ | </item> <height>100</height><width>400</width> <variable>TREE2</variable> </tree> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' GTKDIALOG=gtkdialog if [ -x "$HOME/bin/gtkdialog" ]; then GTKDIALOG="$HOME/bin/gtkdialog" fi $GTKDIALOG --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Tree With Actions> <text> <label> "The column 0 is the stoc icon name. However the exported column is the 1st column, so you see the first text column printed to the standard output." </label> </text> <tree rules_hint="true" exported_column="1"> <label>One | Two | Three </label> <item stock="gtk-yes">r1c1|r1c2|r1c3</item> <item stock="gtk-no">r2c1|r2c2|r2c3</item> <item stock="gtk-no">r3c1|r3c2|r3c3</item> <variable>TREE</variable> <height>100</height><width>200</width> <action>echo action[Double Click]: $TREE</action> <action signal="button-press-event">echo button-press-event[BUTTON=$BUTTON]: $TREE</action> <action signal="button-release-event">echo button-release-event[BUTTON=$BUTTON]: $TREE</action> <action signal="cursor_changed">echo cursor_changed: $TREE</action> </tree> </frame> <frame Another Tree With Actions> <tree rules_hint="true"> <label>One | Two | Three </label> <item>r1c1|r1c2|r1c3</item> <item>r2c1|r2c2|r2c3</item> <item>r3c1|r3c2|r3c3</item> <variable>OTHERTREE</variable> <height>100</height><width>200</width> <action>echo action[Double Click]: $OTHERTREE</action> <action signal="button-press-event">echo button-press-event[BUTTON=$BUTTON]: $TREE</action> <action signal="button-release-event">echo button-release-event[BUTTON=$BUTTON]: $TREE</action> <action signal="cursor_changed">echo cursor_changed: $OTHERTREE</action> </tree> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash # # The <tree> tag can hold the following attributes for using as a default icon: # o stock or stock_id # o icon or icon_name # export MAIN_DIALOG=' <vbox> <tree stock="gtk-apply"> <input file>tmp.text</input> <label>Device | Directory | File</label> <item>Floppy Disk | /floppy/ | ak.tex</item> <item>Floppy Disk | /floppy/ | ak.dvi</item> <item icon="pdf">Floppy Disk | /floppy/ | ak.ps</item> <item icon_name="rpm">Floppy Disk | /floppy/ | ak.pdf</item> <item stock="gtk-cdrom">CD_ROM Drive | /cdrom/ | </item> <height>100</height><width>400</width> <variable>TREE2</variable> </tree> <tree icon_name="file-devel-cpp"> <input file>tmp.text</input> <label>Device | Directory | File</label> <item>Floppy Disk | /floppy/ | ak.tex</item> <item>Floppy Disk | /floppy/ | ak.dvi</item> <item icon="pdf">Floppy Disk | /floppy/ | ak.ps</item> <item icon_name="rpm">Floppy Disk | /floppy/ | ak.pdf</item> <item stock="gtk-cdrom">CD_ROM Drive | /cdrom/ | </item> <height>100</height><width>400</width> <variable>TREE2</variable> </tree> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' GTKDIALOG=gtkdialog if [ -x "$HOME/bin/gtkdialog" ]; then GTKDIALOG="$HOME/bin/gtkdialog" fi $GTKDIALOG --program=MAIN_DIALOG
#! /bin/bash # # The <input> tags can have attributes setting which input column holds the # icon information: # o stock_column # o icon_column # export MAIN_DIALOG=' <vbox> <tree> <label>Stock name | Permissions|Filename</label> <input>./list.sh</input> <height>200</height><width>600</width> <variable>TREE1</variable> </tree> <tree stock="gtk-file"> <label>Permissions|Filename</label> <input icon_column="0">./list.sh</input> <height>200</height><width>600</width> <variable>TREE2</variable> </tree> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' GTKDIALOG=gtkdialog if [ -x "$HOME/bin/gtkdialog" ]; then GTKDIALOG="$HOME/bin/gtkdialog" fi $GTKDIALOG --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Insert and Remove> <tree rules_hint="true" headers_visible="false"> <height>100</height><width>400</width> <variable>TREE</variable> </tree> <hbox> <entry> <variable>ENTRY</variable> </entry> <button> <input file stock="gtk-add"></input> <action type="insert">ENTRY,TREE</action> </button> <button> <input file stock="gtk-remove"></input> <action type="removeselected">TREE</action> </button> </hbox> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Stock> <tree rules_hint="true" exported_column="1"> <height>400</height><width>250</width> <label>Stock ID</label> <item stock="gtk-dialog-authentication">gtk-dialog-authentication</item> <item stock="gtk-dialog-info">gtk-dialog-info</item> <item stock="gtk-dialog-warning">gtk-dialog-warning</item> <item stock="gtk-dialog-error">gtk-dialog-error</item> <item stock="gtk-dialog-question">gtk-dialog-question</item> <item stock="gtk-dnd">gtk-dnd</item> <item stock="gtk-dnd-multiple">gtk-dnd-multiple</item> <item stock="gtk-about">gtk-about</item> <item stock="gtk-add">gtk-add</item> <item stock="gtk-apply">gtk-apply</item> <item stock="gtk-bold">gtk-bold</item> <item stock="gtk-cancel">gtk-cancel</item> <item stock="gtk-cdrom">gtk-cdrom</item> <item stock="gtk-clear">gtk-clear</item> <item stock="gtk-close">gtk-close</item> <item stock="gtk-color-picker">gtk-color-picker</item> <item stock="gtk-convert">gtk-convert</item> <item stock="gtk-connect">gtk-connect</item> <item stock="gtk-copy">gtk-copy</item> <item stock="gtk-cut">gtk-cut</item> <item stock="gtk-delete">gtk-delete</item> <item stock="gtk-directory">gtk-directory</item> <item stock="gtk-disconnect">gtk-disconnect</item> <item stock="gtk-edit">gtk-edit</item> <item stock="gtk-execute">gtk-execute</item> <item stock="gtk-file">gtk-file</item> <item stock="gtk-find">gtk-find</item> <item stock="gtk-find-and-replace">gtk-find-and-replace</item> <item stock="gtk-floppy">gtk-floppy</item> <item stock="gtk-fullscreen">gtk-fullscreen</item> <item stock="gtk-goto-bottom">gtk-goto-bottom</item> <item stock="gtk-goto-first">gtk-goto-first</item> <item stock="gtk-goto-last">gtk-goto-last</item> <item stock="gtk-goto-top">gtk-goto-top</item> <item stock="gtk-go-back">gtk-go-back</item> <item stock="gtk-go-down">gtk-go-down</item> <item stock="gtk-go-forward">gtk-go-forward</item> <item stock="gtk-go-up">gtk-go-up</item> <item stock="gtk-harddisk">gtk-harddisk</item> <item stock="gtk-help">gtk-help</item> <item stock="gtk-home">gtk-home</item> <item stock="gtk-index">gtk-index</item> <item stock="gtk-indent">gtk-indent</item> <item stock="gtk-info">gtk-info</item> <item stock="gtk-unindent">gtk-unindent</item> <item stock="gtk-italic">gtk-italic</item> <item stock="gtk-jump-to">gtk-jump-to</item> <item stock="gtk-justify-center">gtk-justify-center</item> <item stock="gtk-justify-fill">gtk-justify-fill</item> <item stock="gtk-justify-left">gtk-justify-left</item> <item stock="gtk-justify-right">gtk-justify-right</item> <item stock="gtk-leave-fullscreen">gtk-leave-fullscreen</item> <item stock="gtk-missing-image">gtk-missing-image</item> <item stock="gtk-media-forward">gtk-media-forward</item> <item stock="gtk-media-next">gtk-media-next</item> <item stock="gtk-media-pause">gtk-media-pause</item> <item stock="gtk-media-play">gtk-media-play</item> <item stock="gtk-media-previous">gtk-media-previous</item> <item stock="gtk-media-record">gtk-media-record</item> <item stock="gtk-media-rewind">gtk-media-rewind</item> <item stock="gtk-media-stop">gtk-media-stop</item> <item stock="gtk-network">gtk-network</item> <item stock="gtk-new">gtk-new</item> <item stock="gtk-no">gtk-no</item> <item stock="gtk-ok">gtk-ok</item> <item stock="gtk-open">gtk-open</item> <item stock="gtk-paste">gtk-paste</item> <item stock="gtk-preferences">gtk-preferences</item> <item stock="gtk-print">gtk-print</item> <item stock="gtk-print-preview">gtk-print-preview</item> <item stock="gtk-properties">gtk-properties</item> <item stock="gtk-quit">gtk-quit</item> <item stock="gtk-redo">gtk-redo</item> <item stock="gtk-refresh">gtk-refresh</item> <item stock="gtk-remove">gtk-remove</item> <item stock="gtk-revert-to-saved">gtk-revert-to-saved</item> <item stock="gtk-save">gtk-save</item> <item stock="gtk-save-as">gtk-save-as</item> <item stock="gtk-select-color">gtk-select-color</item> <item stock="gtk-select-font">gtk-select-font</item> <item stock="gtk-sort-ascending">gtk-sort-ascending</item> <item stock="gtk-sort-descending">gtk-sort-descending</item> <item stock="gtk-spell-check">gtk-spell-check</item> <item stock="gtk-stop">gtk-stop</item> <item stock="gtk-strikethrough">gtk-strikethrough</item> <item stock="gtk-undelete">gtk-undelete</item> <item stock="gtk-underline">gtk-underline</item> <item stock="gtk-undo">gtk-undo</item> <item stock="gtk-yes">gtk-yes</item> <item stock="gtk-zoom-100">gtk-zoom-100</item> <item stock="gtk-zoom-fit">gtk-zoom-fit</item> <item stock="gtk-zoom-in">gtk-zoom-in</item> <item stock="gtk-zoom-out">gtk-zoom-out</item> </tree> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Icon name examples> <tree rules_hint="true" exported_column="1"> <height>400</height><width>550</width> <label>Icon Names</label> <item icon="gnome-mime-application-encapsulatedpostscript">gnome-mime-application-encapsulatedpostscript</item> <item icon="i-floppy">i-floppy</item> <item icon="image2">image2</item> <item icon="image3">image3</item> <item icon="image">image</item> <item icon="info">info</item> <item icon="install">install</item> <item icon="log">log</item> <item icon="make">make</item> <item icon="man">man</item> <item icon="metafont">metafont</item> <item icon="midi">midi</item> <item icon="mime_ascii">mime_ascii</item> <item icon="mime_empty">mime_empty</item> <item icon="misc_doc">misc_doc</item> </tree> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /usr/bin/gtkdialog -e function list() { ls -lha | grep ^d | awk '{print "stock_folder|" $9}' ls -lha | grep ^- | awk '{print "file-executable|" $9}' } export MAIN_DIALOG=' <vbox> <frame Icon name examples> <tree rules_hint="true" exported_column="0"> <height>200</height><width>400</width> <label>Files</label> <input icon_column="0">list</input> <variable>TREE</variable> </tree> </frame> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> '
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <text><label>Label1</label></text> <entry></entry> </hbox> <hbox> <text><label>Label2</label></text> <entry></entry> </hbox> <hbox> <button cancel></button> <button help></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Space> <hbox spacing="10"> <text><label>spacing</label></text> <entry></entry> </hbox> <hbox homogeneous="true"> <text><label>homogeneous</label></text> <entry></entry> </hbox> </frame> <frame Description> <hbox> <pixmap> <input file stock="gtk-info"></input> </pixmap> <text> <label> "This is a label with a rather long text, so it must be wrapped as the user resizes the window. However, the default label width is 30 characters." </label> </text> </hbox> </frame> <frame Description> <hbox fill="true" expand="true"> <pixmap> <input file stock="gtk-info"></input> </pixmap> <text> <label> "This is a label with a rather long text, so it must be wrapped as the user resizes the window. However, the default label width is 30 characters." </label> </text> </hbox> </frame> <hbox> <button cancel></button> <button help></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Frame1> <text><label>Label1</label></text> <entry></entry> </frame> <frame Frame2> <hbox> <text><label>Label2</label></text> <entry></entry> </hbox> </frame> <hbox> <button cancel></button> <button help></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <notebook labels="Checkbox|Radiobutton|Tree"> <vbox> <checkbox> <label>This is a checkbox</label> </checkbox> <checkbox> <label>Another checkbox</label> </checkbox> <checkbox> <label>The third checkbox</label> </checkbox> </vbox> <vbox> <radiobutton> <label>First radiobutton in the group</label> </radiobutton> <radiobutton> <label>The second radiobutton</label> </radiobutton> <radiobutton> <label>Third radiobutton</label> <default>true</default> </radiobutton> </vbox> <tree> <input file>tmp.text</input> <label>First</label> <item stock="gtk-floppy">This is a floppy</item> <item stock="gtk-cdrom">This is a CD-ROM</item> <item>This line has no icon</item> <variable>EDITOR</variable> </tree> </notebook> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <chooser> <height>500</height><width>600</width> <variable>CHOOSER</variable> </chooser> <hbox> <button help></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <menubar> <menu> <menuitem stock="gtk-open"> <action>echo You selected the open menu item.</action> </menuitem> <menuitem stock="gtk-save"> <action>echo You selected the open menu item.</action> </menuitem> <separator></separator> <menuitem stock="gtk-quit"> <action>echo You selected the quit menu item</action> <action type="exit">exit by menu</action> </menuitem> <label>File</label> </menu> <menu> <menuitem stock="gtk-copy"> <action>echo You selected the copy menuitem.</action> </menuitem> <menuitem stock="gtk-cut"> <action>echo You selected the cut menuitem.</action> </menuitem> <menuitem stock="gtk-paste"> <action>echo You selected the paste menuitem.</action> </menuitem> <label>Edit</label> </menu> <menu> <menuitem> <label>A menu item</label> <action>echo You selected the custom menu item.</action> </menuitem> <label>Item</label> </menu> </menubar> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <menubar> <menu> <menuitem stock="gtk-open"> <action>echo You selected the open menu item.</action> </menuitem> <menuitem stock="gtk-save"> <action>echo You selected the save menu item.</action> </menuitem> <separator></separator> <menuitem stock="gtk-quit"> <action>echo You selected the quit menu item</action> <action type="exit">exit by menu</action> </menuitem> <label>Stock</label> </menu> <menu> <menuitem icon="gtk-floppy"> <label>This is a floppy</label> <action>echo You selected the floppy menuitem.</action> </menuitem> <menuitem icon="gtk-cdrom"> <label>This is a CD-ROM</label> <action>echo You selected the CD-ROM menuitem.</action> </menuitem> <label>Icon</label> </menu> <menu> <menuitem> <label>This is a text</label> <action>echo You selected the text item.</action> </menuitem> <label>Label</label> </menu> </menubar> <hbox> <button cancel></button> <button ok></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export MAIN_DIALOG=' <window> <vbox> <frame DEscription> <text> <label>This is an example window.</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export DIALOG=' <window title="Example Window" icon-name="gtk-dialog-warning"> <vbox> <frame Description> <text> <label>icon-name="gtk-dialog-warning"</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG export DIALOG=' <window title="Example Window" decorated="false"> <vbox> <frame Description> <text> <label>decorated=false</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG export DIALOG=' <window title="Example Window" resizable="false"> <vbox> <frame Description> <text> <label>resizable=false</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG export DIALOG=' <window title="Example Window" window_position="1"> <vbox> <frame Description> <text> <label>window_position=1 (GTK_WIN_POS_CENTER)</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG export DIALOG=' <window title="Example Window" window_position="2"> <vbox> <frame Description> <text> <label>window_position=2 (GTK_WIN_POS_MOUSE)</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG export DIALOG=' <window title="Example Window" skip_taskbar_hint="true"> <vbox> <frame Description> <text> <label>skip_taskbar_hint=true</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG
#! /bin/bash export DIALOG=' <window title="Example Window" icon-name="gtk-dialog-warning"> <vbox> <frame Description> <text> <label>Text</label> </text> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> <action signal="button-press-event">echo delete-event</action> </window> ' gtkdialog --program=DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Simple> <hbox> <entry> <variable>FILE</variable> </entry> <button> <input file stock="gtk-open"></input> <variable>FILE_BROWSE</variable> <action type="fileselect">FILE</action> </button> </hbox> </frame> <frame Filename> <hbox> <entry accept="filename"> <label>Select an Existing File</label> <variable>FILE_FILENAME</variable> </entry> <button> <input file stock="gtk-open"></input> <variable>FILE_BROWSE_FILENAME</variable> <action type="fileselect">FILE_FILENAME</action> </button> </hbox> </frame> <frame Filename for Save> <hbox> <entry accept="savefilename"> <label>Select a Filename</label> <variable>FILE_SAVEFILENAME</variable> </entry> <button> <input file stock="gtk-open"></input> <variable>FILE_BROWSE_SAVEFILENAME</variable> <action type="fileselect">FILE_SAVEFILENAME</action> </button> </hbox> </frame> <frame Directory> <hbox> <entry accept="directory"> <label>Select a Directory</label> <variable>FILE_DIRECTORY</variable> </entry> <button> <input file stock="gtk-open"></input> <variable>FILE_BROWSE_DIRECTORY</variable> <action type="fileselect">FILE_DIRECTORY</action> </button> </hbox> </frame> <frame New Directory> <hbox> <entry accept="newdirectory"> <label>Create New Directory (really)</label> <variable>FILE_NEWDIRECTORY</variable> </entry> <button> <input file stock="gtk-open"></input> <variable>FILE_BROWSE_NEWDIRECTORY</variable> <action type="fileselect">FILE_NEWDIRECTORY</action> </button> </hbox> </frame> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG
#! /bin/bash export DIALOG=' <window title="Example Window" icon-name="gtk-dialog-warning"> <vbox> <frame Widgets> <text> <label>Label</label> <action signal="button-press-event">echo Label: button-press-event</action> <action signal="button-release-event">echo Label: button-release-event</action> <action signal="configure-event">echo Label: configure-event</action> <action signal="enter-notify-event">echo Label: enter-notify-event</action> <action signal="leave-notify-event">echo Label: leave-notify-event</action> <action signal="focus-in-event">echo Label: focus-in-event</action> <action signal="focus-out-event">echo Label: focus-out-event</action> <action signal="key-press-event">echo Label: key-press-event</action> <action signal="key-release-event">echo Label: key-release-event</action> <action signal="hide">echo Label: hide</action> <action signal="show">echo Label: show</action> <action signal="map-event">echo Label: map-event</action> <action signal="unmap-event">echo Label: unmap-event</action> </text> <entry> <default>Entry</default> <action signal="button-press-event">echo Entry: button-press_event</action> <action signal="button-release-event">echo Entry: button-release-event</action> <action signal="configure-event">echo Entry: configure-event</action> <action signal="enter-notify-event">echo Entry: enter-notify-event</action> <action signal="leave-notify-event">echo Entry: leave-notify-event</action> <action signal="focus-in-event">echo Entry: focus-in-event</action> <action signal="focus-out-event">echo Entry: focus-out-event</action> <action signal="key-press-event">echo Entry: key-press-event</action> <action signal="key-release-event">echo Entry: key-release-event</action> <action signal="hide">echo Entry: hide</action> <action signal="show">echo Entry: show</action> <action signal="map-event">echo Entry: map-event</action> <action signal="unmap-event">echo Entry: unmap-event</action> </entry> </frame> <hbox> <button ok> <action signal="button-press-event">echo Button: button-press_event</action> <action signal="button-release-event">echo Button: button-release-event</action> <action signal="configure-event">echo Button: configure-event</action> <action signal="enter-notify-event">echo Button: enter-notify-event</action> <action signal="leave-notify-event">echo Button: leave-notify-event</action> <action signal="focus-in-event">echo Button: focus-in-event</action> <action signal="focus-out-event">echo Button: focus-out-event</action> <action signal="key-press-event">echo Button: key-press-event</action> <action signal="key-release-event">echo Button: key-release-event</action> <action signal="hide">echo Button: hide</action> <action signal="show">echo Button: show</action> <action signal="map-event">echo Button: map-event</action> <action signal="unmap-event">echo Button: unmap-event</action> </button> </hbox> </vbox> <action signal="button-press-event">echo Window: button-press_event</action> <action signal="button-release-event">echo Window: button-release-event</action> <action signal="configure-event">echo Window: configure-event</action> <action signal="delete-event">echo Window: delete-event</action> <action signal="destroy-event">echo Window: destroy-event</action> <action signal="enter-notify-event">echo Window: enter-notify-event</action> <action signal="leave-notify-event">echo Window: leave-notify-event</action> <action signal="focus-in-event">echo Window: focus-in-event</action> <action signal="focus-out-event">echo Window: focus-out-event</action> <action signal="key-press-event">echo Window: key-press-event</action> <action signal="key-release-event">echo Window: key-release-event</action> <action signal="hide">echo Window: hide</action> <action signal="show">echo Window: show</action> <action signal="map-event">echo Window: map-event</action> <action signal="unmap-event">echo Window: unmap-event</action> </window> ' gtkdialog --program=DIALOG
#! /bin/bash export DIALOG=' <window title="Question" icon-name="gtk-dialog-question"> <vbox> <hbox> <text> <label>Label:</label> </text> <entry activates-default="true"> <default>Default text</default> <variable>ENTRY</variable> </entry> </hbox> <hbox> <button cancel></button> <button can-default="true" has-default="true" use-stock="true"> <label>gtk-ok</label> </button> </hbox> </vbox> </window> ' gtkdialog --program=DIALOG
#! /bin/bash export MAIN_DIALOG=' <vbox> <frame Imperative Example> <checkbox active="true"> <label>First checkbox</label> <variable>CHECKBOX</variable> </checkbox> <command assignment="n := 1"></command> <while condition="n = 22"> <checkbox> <label>The second checkbox</label> </checkbox> <command assignment="n := n + 1"></command> </while> </frame> <hbox> <button ok> <variable>OKBUTTON</variable> </button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG --print-ir #gtkdialog --program=MAIN_DIALOG
#! /usr/bin/gtkdialog -e function print_this() { echo "print: $1" } export MAIN_DIALOG=' <vbox> <button> <label>function</label> <action>print_this button</action> </button> <button> <label>Exit</label> </button> </vbox> '
#! /usr/bin/gtkdialog -f <vbox> <button> <label>Xterm</label> <action>xterm&</action> </button> <button> <label>Exit</label> </button> </vbox>
<vbox> <hbox> <text> <label>Input:</label> </text> <entry> <variable>ENTRY</variable> </entry> </hbox> <hbox> <button help></button> <button cancel></button> <button ok></button> </hbox> </vbox>
#! /bin/bash export MAIN_DIALOG=' <vbox> <hbox> <button> <label>Label</label> <action>echo You pressed the button with the label.</action> </button> <button> <input file>fileopen.xpm</input> <action>echo You pressed the button with the pixmap.</action> </button> </hbox> <hbox> <button yes> <action>echo You pressed the Yes button.</action> </button> <button no> <action>echo You pressed the No button.</action> </button> </hbox> <hbox> <button ok> <action>echo You pressed the OK button.</action> </button> <button cancel> <action>echo You pressed the Cancel button.</action> </button> <button help> <action>echo You pressed the Help button.</action> </button> </hbox> <hbox> <button ok></button> <button cancel></button> </hbox> </vbox> ' gtkdialog --program=MAIN_DIALOG --print-ir