Version control
This is the first public release so I will call it yad-tips-0.0.1
It's a long way from completion but I encourage public input.
My preferred method of receiving feedback is via email at:
smokey01@internode.on.net

If you wish to contribute please email me notecase nodes of your work
and I will include them, maybe with some minor changes, to
maintain uniformity.

Thanks
Introduction
Yet Another Dialog - YAD is a simple tool for developing Graphical User Interfaces.

It's similar to Zenity but with lot more functionality.

It's a single binary and only 144k for the Fatdog64 version, 150k in tahrpup.

It will integrate with bash and gtkdialog scripts.

In it's simplest form, type yad in a terminal.



This help has been developed in a similar order as yad's internal help.

Type yad --help-all to see all command line help.

Unfortunately the inbuilt help does not provide enough information to use yad
to it's full potential. This is why I developed this tutorial.

I hope you find it usefull.

Code is highlighted in blue, warnings in red and output in purple.

If the bold blue text is underlined then it's probably executable.

Comments and example can be sent to smokey01@internode.on.net
or post on the puppy linux forums: http://www.murga-linux.com/puppy/viewtopic.php?t=97458

Cheers

Smokey01 (Grant)


YAD
Section: User Commands (1)
Updated: Marth 24, 2011
Index
NAME
yad - display GTK+ dialogs


SYNOPSIS
yad[options]


DESCRIPTION
YAD is a program that will display GTK+ dialogs, and return(either in the return code, or on standard output) the usersinput. This allows you to present information, and ask for informationfrom the user, from all manner of shell scripts.

YAD is the fork of Zenity program.


OPTIONS
This program follows the usual GNU command line syntax, with longoptions starting with two dashes (`-').

Dialog options

--calendar
Display calendar dialog.
--color
Display color selection dialog.
--dnd
Display drag-and-drop box.
--entry
Display text entry dialog.
--icons
Display box with shortcut icons.
--file
Display file selection dialog.
--font
Display font selection dialog.
--form
Display form dialog
--list
Display list dialog
--notification
Display notification icon.
--progress
Display progress indication dialog.
--text-info
Display text information dialog.
--scale
Display scale dialog.

General options

--title=TITLE
Set the dialog title.
--window-icon=ICONPATH
Set the window icon.
--width=WIDTH
Set the dialog width.
--height=HEIGHT
Set the dialog height.
--timeout=TIMEOUT
Set the dialog timeout in seconds.
--timeout-indicator=POSITION
Show timeout indicator in given position. Positions are top, bottom, left or right.Style of indicator may be set through the gtkrc file. See http://code.google.com/p/yad/wiki/TimeoutIndicator for details.
--kill-parent
Send SIGTERM to parent process.
--text=STRING
Set the dialog text.
--image=IMAGE
Set the dialog image which appears on the left side of dialog.IMAGE might be file name or icon name from current icon theme.
--image-on-top
Show image above main widget instead of left.
--icon-theme=THEME
Use specified GTK icon theme instead of default.
--expander=TEXT
Hide main widget with expander. TEXT is an optional argument with expander's label.
--button=BUTTON:ID
Add the dialog button. May be used several times. ID is an exit code.BUTTON may be gtk stock item name for predefined buttons (like gtk-close or gtk-ok) or simple text label. Full list of stock items may be found in gtk-demo program, in snippet called "Stock Items and Icon Browser". If no buttons specified OK and Cancel buttons used. See EXIT STATUS section for more.
--no-buttons
Don't show buttons.
--no-markup
Don't use pango markup in dialog's text.
--always-print-result
Always print result.
--dialog-sep
Show separator between dialog and buttons. Works only with gtk+-2.0.
--borders=NUM
Set dialog window borders.
--sticky
Make window visible on all desktops.
--fixed
Make window fixed width and height.
--center
Place window on center of screen.
--mouse
Place window under mouse position.
--on-top
Place window over other windows.
--undecorated
Make window undecorated (remove title and window borders).
--skip-taskbar
Don't show window in taskbar and pager.
--geometry=WIDTHxHEIGHT+X+Y
Use standard X Window geometry notation for placing dialog.When this option is used, width, height, mouse and center options areignored.
--selectable-labels
If set, user can select dialog's text and copy it to clipboard. This option also affects on label fields in form dialog.

Calendar options

--day=INT
Set the calendar day.
--month=INT
Set the calendar month.
--year=INT
Set the calendar year.
--date-format=PATTERN
Set the format for the returned date. By default is `%x'. See strftime(3) for more details.
--details=FILENAME
Read days description from IFILENAMEP.

File with days details must be in following format:

<date> <description>

date field is date in format, specified with --date-format option. descriptionis a string with date details, which may include Pango markup.

Color selection options

--init-color=COLOR
Set initial color value.
--extra
Show extra information about color in returned string.
--palette[=FILENAME]
Show palette ans set predefined colors from given filename.By default used /etc/X11/rgb.txt.

Drag-and-Drop box options

--command=CMD
Run command when data received. Data strings pass to command as an agrument. By default data just prints to stdout.

Text entry options

--entry-label=STRING
Set the entry label text.
--entry-text=STRING
Set the initial entry text.
--hide-text
Hide the entry text.
--completion
Use completion instead of combo-box.
--editable
Allow changes to text in combo-box.
--numeric
Use spin button instead of text entry. Additional parameters in command line treats as minimum and maximum values and step value (in that order). All this values are optional. Default range is from 0 to 65535 with step 1.
--licon
Set an icon on a left side of entry.
--licon-action
Specify a command which will be run when the left icon clicked. Output of command will be set as entry text.
--ricon
Set an icon on a right side of entry.
--ricon-action
Specify a command which will be run when the right icon clicked. Output of command will be set as entry text.

Any extra data specified in command line adds as an items of combo-box entry, except of numeric mode.

If icon specified and icon action is not given, click on icon just clear the entry. Icons are available only for entry field. Numeric field or combo-boxes will ignore the icons.

Iconbox options

--read-dir=DIRECTORY
Read .desktop files from specified directory.
--generic
Use field GenericName instead of Name for shortcut label.
--sort-by-name
Use field Name instead of filename for sorting items.
--descend
Sort items in descending order. If data reads from stdin this option is useless without --sort-by-name.
--stdin
Read data from stdin. Data must be in order - Name, Tooltip, Icon, Command, InTermseparated by newline. InTerm is a case insensitive boolean constant (TRUE or FALSE).
--item-width
Set items width.
--term
Pattern for terminal. By default use `xterm -e %s' where %s replaced by the command.

If both directory and stdin specified, content of iconbox will be read from directory.

File selection options

--filename=FILENAME
Set the filename.
--multiple
Allow selection of multiple filenames in file selection dialog.
--directory
Activate directory-only selection.
--save
Activate save mode.
--separator=STRING
Specify separator character when returning multiple filenames.
--confirm-overwrite[=TEXT]
Confirm file selection if filename already exists. Optional argument is a text for confirmation dialog.

Font selection options

--fontname=FONTNAME
Set the initial font. FONTNAME is a string with font representation in the form [FAMILY-LIST] [STYLE-OPTIONS] [SIZE].
--preview
Set the preview text.

Form options

--field=LABEL[:TYPE]
Add field to form. Type may be H, RO, NUM, CHK, CB, CBE, FL, DIR, FN, MFL, DT, CLR,BTN or LBL.H - hidden field type. All characters are displayed as the invisible char.RO - field is in read-only mode.NUM - field is a numeric. Initial value format for this field is VALUE[!RANGE[!STEP]],where RANGE must be in form MIN..MAX. `!' is a default item separator.CHK - checkbox field. Initial value is a case insensitive boolean constant (TRUE or FALSE).CB - combo-box field. Initial value is a list VAL1!VAL2!.... The separator is the same as in NUM field.CBE - editable combo-box field. Initial value same as for combo-box.FL - file selection button.DIR - directory selection button.FN - font selection button. Initial value same as in font dialog.MFL - select multiple files. Value of this field is a list of files separated by item-separator.DT - date field.CLR - color selection button.BTN - button field. Initial value is a command runs when button is clicked.LBL - text label. If field name is empty, horisontal separator line will be shown.
--align=TYPE
Set alignment of fields labels. Possible types are left, center or right. Default is left.
--columns=NUMBER
Set number of columns in form. Fields will be placed from top to bottom.
--separator=STRING
Set output separator character. Default is `|'.
--item-separator=STRING
Set separator character for combo-box or scale values. Default is `!'.
--date-format=PATTERN
Set the format for the date fields (same as in calendar dialog).

Additional data in command line interprets as a default values for form fields.

List options

--column=STRING[:TYPE]
Set the column header. Types are TEXT, NUM, FLT, CHK, IMG or TIP. TEXT type is default. Use NUM for integers and FTL for double values. TIP is used for define tooltip column.IMG may be path to image or icon name from currnet GTK+ icon theme.Size of icons may be set in config file. Image field prints as empty value.

Special column names @fore@, @back@ and @font@ sets corresponding rows attributes.Values of those columns don't show in results.
--checklist
Use check boxes for first column.
--separator=STRING
Set output separator characters.
--multiple
Allow multiple rows to be selected.
--editable
Allow changes to text.
--no-headers
Do not show column headers
--print-all
Print all data from the list.
--print-column=NUM
Specify what column will be printed to standard output. 0 may be used to print all columns (this is default).
--hide-column=NUMBER
Hide a specific column.
--expand-column=NUMBER
Set the column expandable by default. 0 sets all columns expandable.
--search-column=NUMBER
Set the quick search column. 0 mean to disable searching. By default search mades on first column.
--limit=NUMBER
Set the number of rows in list dialog. Will be shown only the last NUMBER rows. This option will take effect only when data reading from stdin.
--ellipsize=TYPE
Set ellipsize mode for text columns. TYPE may be NONE, START, MIDDLE or END.
--dclick-action=CMD
Set the CMD as a double-click command. When user double-clicked on row, CMD will be launched with values of all columns as an arguments. By default double-click selects row and act as OK button for simple lists, set the checkbox if --checklist specified and do nothing when list run with --multiple option.When double-click specified Enter acts as a double-click and Ctrl+Enter acts as an OK button.CMD may contain a special character `%s' for setting a position for arguments. By default arguments will be concatenated to the end of CMD.
--regex-search
Use regular expressions in search for text fields.

Notification options

--command=CMD
Set the command running when clicked on the icon.
--listen
Listen for commands on stdin. See NOTIFICATION section.
--separator=STRING
Set separator character for menu values. Default is `|'.
--item-separator=STRING
Set separator character for menu items. Default is `!'.

See NOTIFICATION section for more about separators.

Progress options

When the --progress option is used, yad reads lines of progress data from stdin.When the lines begin with # the text after # is displayed in the progressbar label. Numeric values treats like a persents for progress bar.

--progress-text=STRING
Set text in progress bar to STRING.
--percentage=INT
Set initial percentage.
--rtl
Set Right-To-Left progress bar direction.
--auto-close
Close dialog when 100% has been reached.
--auto-kill
Kill parent process if cancel button is pressed.
--pulsate
Pulsate progress bar.

Text options

--filename=FILENAME
Open specified file.
--editable
Allow changes to text.
--fore=COLOR
Set foreground color of text
--back=COLOR
Set background color of text
--fontname=FONT
Set text font. FONT must be in a Pango font description format.
--wrap
Enable text wrapping.
--justify=TYPE
Set justification. TYPE may be left, right, center or fill.Default is left.
--margins=SIZE
Set text margins to SIZE.
--tail
Autoscroll to end when new text appears. Works only when text is read from stdin.
--show-uri
Make URI in text clickable. Links opens with xdg-open command.

Scale options

--value=VALUE
Set initial value.
--min-value=VALUE
Set minimum value.
--max-value=VALUE
Set maximum value.
--step=VALUE
Set step size.
--page=VALUE
Set paging size. By default page value is STEP*10.
--print-partial
Print partial values.
--hide-value
Hide value.
--vertical
Show vertical scale.
--invert
Invert scale direction.
--mark=[NAME]:VALUE
Add a mark to scale. May be used multiply times. NAME is an optional arguments for set label to mark.

Miscellaneous options

-?, --help
Show summary of options.
--about
Display an about dialog.
--version
Show version of program.

Also the standard GTK+ options are accepted.


NOTIFICATION
Allows commands to be sent to yad in the form command:args.Possible commands are icon, tooltip, visible, action, menu and quit.

icon:ICONNAME
Set notification icon to ICONNAME.
tooltip:STRING
Set notification tooltip.
visible:[true|false|blink]
Set notification icon to visible, invisible or blinking states.
action:COMMAND
Specify the command running when double-clicked on the icon. Special string "quit" exit the program.
menu:STRING
Set popup menu for notification icon.STRING must be in form name1!action1|name2!action2....Empty name add separator to menu.Separator character for values (e.g. `|') sets with --separator argument.Separator character for menu items (e.g. `!') sets with --item-separator argument.
quit
Exit the program. Middle click on icon also send quit command.


USER DEFINED SIGNALS

SIGUSR1
Close dialog with 0 exit code.
SIGUSR2
Close dialog with 1 exit code.


EXIT STATUS

0
The user has pressed OK button
1
The user has pressed Cancel button
70
The dialog has been closed because the timeout has been reached.
252
The dialog has been closed by pressing Esc or used the window functions to close the dialog
Exit codes for user-specified buttons must be specified in command line. Even exit code mean to print result, odd just return exit code.


WIDGETS NAMES

The look and feel of yad's dialogs can be customized through gtkrc file. Here is the names of yad's widgets:

Widget name Widget type Description
yad-dialog-window GtkDialog Dialog window
yad-dialog-image GtkImage Dialog image
yad-dialog-label GtkLabel Dialog text
yad-calendar-widget GtkCalendar Calendar widget
yad-color-widget GtkColorChooser Color selection widget
yad-color-palette GtkTreeView Predefined colors list
yad-entry-label GtkLabel Entry label
yad-entry-widget GtkEntry Entry widget
yad-entry-spin GtkSpinButton Entry widget for numeric values
yad-entry-combo GtkComboBox Entry widget with combo
yad-entry-edit-combo GtkComboBoxEntry Entry widget with editable combo
yad-file-widget GtkFileChooser File selection widget
yad-font-widget GtkFontChooser Font selection widget
yad-form-flabel GtkLabel Field label in form
yad-form-button GtkButton Button field in form
yad-form-entry GtkEntrfy Entry field in form
yad-form-spin GtkSpinButton Numeric entry field in form
yad-form-check GtkCheckButton Checkbox field in form
yad-form-combo GtkComboBox Combo field in form
yad-form-edit-combo GtkComboBoxEntry Editable combo field in form
yad-form-file GtkFileChooserButton File or directory field in form
yad-form-font GtkFontChooserButton Font field in form
yad-form-color GtkColorChooserButton Color field in form
yad-form-label GtkLabel Label field in form
yad-form-separator GtkHSeparator Separator in form
yad-icons-full GtkIconView Icons widget for normal mode
yad-icons-compact GtkTreeView Icons widget for compact mode
yad-list-widget GtkTreeView List widget
yad-progress-widget GtkProgressBar Progressbar widget
yad-vscale-widget GtkScale Vertical scale widget
yad-hscale-widget GtkScale Horizontal scale widget
yad-text-widget GtkTextView Text info widget
yad-timeout-indicator GtkProgreeBar Timeout indicator


EXAMPLES
Display a file selector with the title Select a file toremove. The file selected is returned on standard output.

yad --title="Select a file to remove" --file-selection

Display a text entry dialog with the title Select Host and thetext Select the host you would like to flood-ping. The enteredtext is returned on standard output.

yad --title "Select Host" --entry --text "Select the host you would like to flood-ping"

Display a dialog, asking Microsoft Windows has been found! Wouldyou like to remove it?. The return code will be 0 (true in shell)if YES is selected, and 1 (false) if NO is selected.

yad --image "dialog-question" --title "Alert" --button=gtk-yes:0 --button=gtk-no:1 --text "Microsoft Windows has been found! Would you like to remove it?"

Show the search results in a list dialog with the title Search Resultsand the text Finding all header files....

find . -name '*.h' | yad --list --title "Search Results" --text "Finding all header files.." --column "Files"

Show an icon in the notification area

yad --notification --image=update.png --text "System update necessary!" --command "xterm -e apt-get upgrade"

Display a weekly shopping list in a check list dialog with Apples and Oranges pre selected

yad --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges FALSE Pears FALSE Toothpaste

Display a progress dialog while searching for all the postscript files in your home directory

find $HOME -name '*.ps' | yad --progress --pulsate

Display a box with all of the installed desktop applications

yad --icons --read-dir=/usr/share/applications


DEVELOPMENT
There are some developers features providing with YAD.

YAD icon browser is a graphical tool for discover icons in current or user-specified GTK+ icon theme. Launch it as
yad-icon-browser [theme]

When using autoconf you may use special m4 macro AM_PATH_YAD for looking for yad and check it version. Usage of this macro is

AM_PATH_YAD([MIN-VERSION],[ACT-FOUND],[ACT-NOT-FOUND])


AUTHOR
Yad was written by Victor Ananjevsky <ananasikAATTgmail.com>.

General Options
This is where you will find the general options which are the majority of commands
that you would likely use on a daily basis.

Each of the options are explained below in the sub menus.

In each case I will try to provide an example and an output graphic.

This will allow you to cut & paste the code to save you some time and also see the result of the command.
--title
A custom title can be added to the bar by adding the --title option.

yad --title "This is my title"



You will notice all the text in the default dialog does not fit.

To make the dialog wider, use the --width option.

--window-icon=ICONPATH
This allows you to choose your own icon.

You may choose one from the available icons in gtk-dialog such as:

yad --window-icon=gtk-yes



Which will give you a green ball on the title bar.

You can also select your own icon by defining the path to it.

yad --window-icon=/root/up.png



Of course for this to work the icon file must be available.



--width=WIDTH
To make the dialog a bit wider add the --width option

yad --title "This is my title" --width=200







--height=HEIGHT
There is also a height option.

yad --title "This is my title" --width=200 --height=200



--geometry+WxH+X+Y
This command allows you to set the Width and Height and X+Y position on the screen.

For example: Suppose you want to create a dialog 400 pixel wide,
400 pixels high dialog at location X in pixels 512 and Y at 384 pixels.

If your screen resolution was 1024 x 768 then the top left corner of your 400 x 400 dialog should be in the centre of your screen.

yad --geometry=400x400+512+384

Now if you wanted the centre of your dialog to be in the centre of your screen you would type:

yad --geometry=400x400

Simply leave off the X and Y coordinates. X=horizontal, Y=vertical.

Just remember, there are minimum defaults. You can't make the dialog smaller than the default size.

Try yad --geometry 1x1



As you can see it's clearly bigger than 1x1.

Be careful though, because it will let you define a much bigger dialog than your screen size.

If you try yad --geometry 3000x3000 your complete screen will be consumed unless your screen size is bigger than 3000x3000.

Press the Enter Key to return to normality.




--timeout
The --timeout command closes the dialog after a specified time.

yad --timeout=10 will automatically close the dialog after 10 seconds.

You can press Enter, click on Ok or Cancel to close it sooner.
--timeout-indicator=POS
This will display a dialog and also a countdown progress bar, very cool.

yad --timeout=10 --timeout-indicator=top



You need to use the --timeout command with the --timeout-indicator

You will find many commands depend on others as you work through the tutorial.
--text=TEXT
Place text on the dialog.

yad --text="Good Morning"



--text-align
To justify text use --text-align=TYPE where type can be left, right or center.

yad --text="Good Morning" --text-align=center



You need to use the --text-align command with --text command.
--image=IMAGE
This will allow you to place an image in your dialog box.

yad --image /root/iow2.jpg





--image-on-top
--image-on-top Show image above main widget

Still working on this one.
--icon-theme=THEME
--icon-theme=THEME Use specified icon theme instead of default

Mmm still struggling with this
--expander=TEXT
--expander=TEXT shows hidden text.

yad --entry --expander="click here to show entry"



Click on the twistie to show hidden entry box.



Whatever you type is parsed like the script below.

#!/bin/sh
ANSWER=`yad --entry --expander="click here to show entry"`
yad --text="You typed $ANSWER in the entry box"
--button=NAME:ID
This command allows you to add your own buttons to the dialog.

Let's create three button. We will call them Floppy, Preferences and Information.

yad --button=gtk-floppy:0 --button=gtk-preferences:0 --button=gtk-info:0



It retrieves the default gtkdialog icons.

To see what is available paste the below into a script.

#! /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



--no-buttons
As it says, this will create a dialog without any buttons.

yad --no-buttons --width=200 --height=100



I added the --width and --height commands or the dialog would have been very small.

It's actually the buttons on the default dialog that set the width.

Example:

yad --no-buttons



Not very attractive.


--no-markup
--no-markup Don't use pango markup language in dialog's text

Not sure what this means
--borders=NUMBER
This sets the width of the border around the dialog.

yad --borders=100 --text="Wow, that's a wide border"



--always-print-result
Haven't worked this one out yet.
--selectable-labels
This allows you to select the text from a dialog. The default in no select.

yad --text="nah nah you can't select me"

yad --text="Ah ooh, now you can" --selectable-labels



This means you can copy and paste from the dialog.
--sticky
Make window visible on all desktops.
--fixed
The --fixed command removed the ability to resize the dialog.

Note the resizing handles have disappeared.

yad --fixed



--on-top
Places the dialog on top of other windows.

yad --on-top

It always seems to open on top anyway.
--center
This is an easy way to position the dialog in the centre of your screen.

yad --center
--mouse
This will place the dialog at the position where your mouse cursor is.

yad --mouse
--undecorated
This command removed the title bar and borders from the dialog.

yad --undecorated



If you do --no-buttons and --undecorated like this:

yad --no-buttons --undecorated

You will have trouble closing the dialog unless you use a --timeout=5

yad --no-buttons --undecorated --timeout=5 --text="Look ma no buttons and borders"

yad --no-buttons --undecorated --timeout=5 --text="Look ma no buttons and borders"



--skip-taskbar
As it says. It doesn't show the dialog in the task bar.

Yes, I know this may be confusing so here is a shot of my task bar with and without the
--skip-taskbar command.

yad --skip-taskbar



yad




--kill-parent
I think this kills the parent if it's been spawned.

More experimenting required.
--print-xid
--print-xid Print X Window Id to the stderr

More research required
Calendar options
This will display a calendar showing the current Day, Month and Year.

yad --calendar



It will also show the date selected so you can parse it to something else.

You can capture the date as a variable like this and parse to to another dialog:

#!/bin/sh
THEDATE=`yad --calendar`
yad --text="You chose $THEDATE"


--day=DAY
yad --calendar --day=20 sets the 20th day of the current month.



--month=MONTH
yad --calendar --month=2 sets the month of the current year and day.



--year=YEAR
yad --calendar --year=2012 sets the month of the current year and day.

Houston we have a problem. The year switch doesn't appear to work in Fatdog.

yad --calendar --year=2012
Segmentation fault

However this works:
yad --calendar --year=2012 --month=2 --day=21

--date-format=PATTERN
yad --calendar will produce the following output of the current day month and year:
25/01/15

yad --calendar --date-format=%d%m%y
output will be:
250115
--details=FILENAME
Color selection options
--fore and --back works only for --text-info dialog
--init-color=COLOR
yad --init-color=red
--palette=FILENAME
--extra
Drag & Drop options
This will make the GUI able to Drag and Drop.

When you drop a file on the GUI it will output the filepath.

yad --dnd



After dropping a file named yad.jpg on the dialog you get this:
file:///root/yad.jpg

To make the output useful you need to do a little string manipulation
using sed EG:

yad --dnd | sed 's/^.......//'
/root/yad.jpg

You can also drag and drop multiple files onto the gui.

Here is an example of a md5sum check.
Create the script below and make it executable.
Execute the script, drop files onto it and press OK.

#!/bin/sh
v=`yad --text="Drop your file(s) here:" --dnd | sed 's/^.......//'`
o=`md5sum $v`
yad --title="MD5SUM Check --text="$o"



If you wish to drop one file on at a time and keep refreshing the GUI
and the ability to copy the results, below is another solution.

#!/bin/sh
killall yad
for i in "$@"; do
case "${i}" in
*)
o=`md5sum "${i}"`
yad --title="CheckSum Calculator" --form --field="" "$o" --no-buttons --geometry=550x50+500+0
;;
esac
done







--tooltip
You can use tooltips on this option by simply adding --tooltip. Adding this command alone is not enough. You see, --tooltip steals the text from the --text command so you need to do something like this:

yad --dnd --text "This is a tooltip" --tooltip



You should also notice the text is no longer displayed on the dialog.

If you remove --tooltip from the command, EG:

yad --dnd --text "This is a tooltip"



The text has returned.
--command=CMD
This is a very nice feature.

This provides the ability to drop a file or files onto the dialog then call an application or a script and do something with it.

Lets assume we want to drop a few graphic files onto the dialog then open them in your default graphics viewer. Let's also assume you viewer is viewnior.

Copy and paste the following script to your text editor and make the file executable.

#!/bin/sh
ANSWER=`yad --text="Drag graphics files here" --dnd --tooltip`
viewnior $ANSWER

When you run this script, it will popup a dialog. If you hover your mouse over it you will see the tooltip. Now drag and drop one or many graphic files on the dialog. When you click on the Ok button Viewnior will open and display your graphic files.
Text entry options
Show an entry dialog.

yad --entry




--entry-label=TEXT
Add a label to the entry dialog.

yad --entry --entry-label="Label"



You need to use both the --entry and --entry-label=TEXT commands.
--entry-text=TEXT
Now we will add to the previous example and add --entry-text.

yad --entry --entry-label="Label" --entry-text="Type here"



You can also add the --text command to the dialog and center it.

yad --text-align=center --text="Hello" --entry --entry-label=Label --entry-text="Type here"



When you press enter the "Type here" or whatever text you entered will be parsed. To capture the parsed input you can set the entire dialog to a variable like this:

#!/bin/sh
INPUTTEXT=`yad --text-align=center --text="Hello" --entry --entry-label=Label --entry-text="Type here"`
yad --text="You entered: $INPUTTEXT"


--hide-text=TEXT
This command allows you to hide the text when you type. EG: Passwords or similar.

yad --text-align=center --text="Hello" --entry --entry-label=Label --entry-text="Type here" --hide-text



If you omit the --entry-text="Type here" the entry box will be blank.

yad --text-align=center --text="Hello" --entry --entry-label=Label --hide-text



You will also notice that you don't need to add any text to the --hide-text command.
--completion
Still working on this one.
--numeric
yad --entry --numeric




Uses a spin button for text entry and won't allow character entry.

Entering data can be manually typed in.

There are 6 decimal points. EG: 100.000000
--editable
I haven't worked this one out yet.
--licon=IMAGE
yad --entry --licon=/usr/local/lib/X11/pixmaps/home48.png



Notice the icon justified to the left of the entry box.
--licon-action=CMD
yad --entry --licon=/usr/local/lib/X11/pixmaps/home48.png --licon-action=rox



Click on the rox icon in the entry field to launch rox.


--ricon=IMAGE
yad --entry --ricon=/usr/local/lib/X11/pixmaps/home48.png



If the icon cannot be found the yad icon will be used.



Notice the icon justified to the right of the entry box.


--ricon-action=CMD
yad --entry --ricon=/usr/local/lib/X11/pixmaps/home48.png --licon-action=rox



Click on the rox icon in the entry field to launch rox.
File selection options
yad --file will invoke the file select dialog



As you can see the dialog is a bit small to display text. Try increasing width and height.

yad --width=500 --height=400 --file



--filename=FILENAME
The file selection options need to be prefixed by yad --file EG:

yad --file --filename=/root/hello.txt --width=400 (/root/hello.txt must exist)

This will select /root/hello.txt



Notice the file hello.txt is already selected.
--multiple
This option will allow you to select multiple files at the same time.

yad --file --multiple --width=600 --height=400



Use the Ctrl or Shift keys when selecting.

It's all well and good being able to bring up a file select dialog but it needs to be able to parse the
information selected.

One way is to assign the file selection dialog to a variable like:

CHOOSEFILE=`yad --file --width=600 --height=400`

To see how it works try selecting a graphics file in a script like this:

#!/bin/sh
CHOOSEFILE=`yad --file --width=600 --height=400`
viewnior $CHOOSEFILE


Make sure you make the script executable. In Rox, right click on the file, select Permission and
then click on the Yes button.

Note the little mark before yad ' and after 400` this is called a backtick, it's the key under the Esc key.
--directory
The --directory command is used to select a directory/folder.

yad --file --directory --width=600 --height=400



Only directories will be displayed, not files.
--save
yad --file --directory --save --width=600 --height=400
--separator=SEPARATOR
--confirm-overwrite=[TEXT]
--file-filter=NAME | PATTERN1 PATTERN2 ...
The --file-filter command will filter the files.

If you only want to display jpg and png files then:

yad --width=600 --height=400 --file --file-filter "Graphic files | *.jpg *.png"



Directories will also be displayed along with jpg and png files.
Font selection options
yad --font will invoke the font dialog.



--fontname=FONTNAME
This command sets the font type.

You can also specify bold, italic, and size. Note the quotes.

yad --width=250 --text-info < hello.txt --fontname="Serif bold italic 20"



--preview=TEXT
The --preview command allows you to set the preview text

yad --font --preview "This is the preview text"



The = symbol after preview is optional.
Form options
http://www.thelinuxrain.com/articles/multiple-item-data-entry-with-yad

http://rpm.pbone.net/index.php3/stat/45/idpl/17003956/numer/1/nazwa/yad

holidays=$(echo "Gold Coast,Bali,Phuket,Sydney,other")
yad --title="My YAD Test" --text="Please enter your details:" \
--image="/usr/share/icons/phone.png" \
--form --date-format="%-d %B %Y" --separator="," --item-separator="," \
--field="First Name" \
--field="Last Name" \
--field="Status":RO \
--field="Date of birth":DT \
--field="Last holiday":CBE \
--field="List your 3 favourite foods:":TXT \
"" "" "All round good guy" "Click calendar icon" "$holidays"



--field=LABEL[:TYPE]
Add field to form (TYPE - H, RO, NUM, CHK, CB, CBE, FL, SFL, MFL, DIR, CDIR, MDIR, FN, DT, CLR, BTN, LBL or TXT)

Make the text hidden
yad --form --field="H:":H "Hidden Text"


Make field read only
"ad --form --field="RO:":RO "Read Only"


Number selector
" d --form --field="NUM:":NUM "100"


Check Box - Options are True or False
E" --form --field="CHK:":CHK "TRUE|FALSE"


When using a Combo Box you need to specify the --item-separator command.
I have used "," but you could use a space EG: --item-separator=" "
ree" --form --item-separator="," --field="CB:":CB "One,Two,Three"


The CBE command allows you to edit the Combo Box.
hree"--form --item-separator="," --field="CBE:":CBE "One,Two,Three"


File Location starting in /root
ad --form --field="FL:":FL "/root"


Click on the folder to select a file
L:":SFLform --field="SFL:":SFL


Multiple file selection - use shift or ctrl key to select
FL:":MFLorm --field="MFL:":MFL



Select a directory/folder
yad --form --field="DIR:":DIR


Change directory
yad --form --field="CDIR:":CDIR


Make or create a directory
yad --form --field="MDIR:":MDIR


Select font and size
yad --form --field="FN:":FN


Select Date - click on little Calendar
yad --form --field="DT:":DT


To display the big calendar.



Select colour from a colour picker
yad --form --field="CLR:":CLR


Then click on the black button


Create a Button
yad --form --field="This Button launches Rox":BTN rox


Add a label
yad --form --field="This is a Label":LBL


Create a text box
yad --form --field="This is a Text Box":TXT









--align=TYPE
Set alignment of fileds labels (left, center or right)

yad --form --align=center --field="This is a Label is centered":LB

--columns=NUMBER
Set number of columns in form.

--separator=SEPARATOR
Set output separator character.
--item-separator=SEPARATOR
Set separator character for combobox or scale data.
--date-format=PATTERN
Set the format for the returned date.
Icons box options
--read-dir=DIRECTORY
--compact
--generic
--stdin
--item-width
--term=PATTERN
Use specified pattern for launch command in terminal (default: xterm -e %s)

--sort-by-name
--descend
List options
You can do some very cool things with the --list command.

yad --list --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69




Lets have a look at a really simple but useful shopping List example.

First create a text file called /root/shopping.list

In this list type or copy the following data:

true
milk
false
bread
false
eggs
false
butter
false
tomato soupg
false
flour
false
steak
false
sausages
false
carrots
true
beans

Here is the yad program that reads the file and lets you select the items.

yad --height=300 --list --checklist --column=Buy --column=Item < /root/shopping.list



This is good but maybe you need to print the list so you can take it to the shop.

yad --button=gtk-print:0 --button=gtk-cancel:0 --height=300 --list --checklist --column=Buy --column=Item < /root/shopping.list > /root/printlist --print-column=2 --separator= && yad --print --add-preview --filename=/root/printlist



As you can see the OK button has been replaced with a Print button.

When you click on print, the Print dialog is invoked. You can Print Preview then Print the list if you wish.


--no-headers
Don't show column headers.

You need to use --column with the --list command but you don't have to display the headers.

yad --list --no-headers --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69

--column=COLUMN[:TYPE]
Set the column header (TYPE - TEXT, NUM, FLT, CHK, IMG or TIP)

--column=STRING[:TYPE] Set the column header. TYPE may be:

TEXT type is default (default)
NUM for integers
FLT for double values.
CHK checkboxes are a boolean columns.
RD radio toggle are a boolean columns.
IMG may be path to image or icon name from currnet GTK+ icon theme.Size of
icons may be set in config file. Image field prints as empty value.
HD type means a hidden column. Such columns are not displayes in the list,
only in output.
TIP is used for define tooltip column.

yad --list --column=Age:num --column=Select:chk --column=Comment:text 22 true Good





--checklist
Use check boxes for first column

yad --checklist --list --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69







--radiolist
Alias to checklist (deprecated)

No longer used. --radiolist will use --checklist.

yad --radiolist --list --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69



--separator=SEPARATOR
Set output separator character. The default is "|"

yad --checklist --list --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69



When you select Richard and click on OK, this is the output you get:

TRUE|Richard|Dick|69

Now if you add --separator=, to the command list:

yad --checklist --list --separator=, --column=Tick --column=Name --column=Nickname --column=Age false William Bill 40 false Richard Dick 69

Your output is:
TRUE,Richard,Dick,69,


--multiple
Allow multiple rows to be selected

When using the --checklist command you can select multiple rows. If you don't want a checklist then you need to use the --multiple command to select multiple rows.

Note: you also need to change the columns from 4 to 3 from the previous example and remove the false data.

yad --list --multiple --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69

You do need to hold the shift or Ctrl key when selecting the row.



--editable
Allow changes to text.

yad --list --editable --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69



You can edit each of the fields. When you click on OK the changes will be parsed.

Richard|George|69|
--print-all
Print all data from list

yad --list --print-all --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69

The --print-all command will parse all rows although I have only selected one.



William|Bill|40|
Richard|Dick|69|

--ellipsize=TYPE
Set ellipsize mode for text columns (TYPE - NONE, START, MIDDLE or END)

yad --list --ellipsize=end --column=Name --column=Nickname --column=Age William Bill 40 Richard Dick 69


--print-column=NUMBER
Print a specific column. By default or if 0 is specified will be printed all columns
--hide-column=NUMBER
Hide a specific column
--expand-column=NUMBER
Set the column expandable by default. 0 sets all columns expandable
--search-column=NUMBER
Set the quick search column. Default is first column. Set it to 0 for disable searching
--limit=NUMBER
Set the limit of rows in list
--dclick-action=CMD
Set double-click action
--regex-search
Use regex in search
Multi progress bars options
eval exec yad --title="xdf" --image=drive-harddisk --text="Disk\ usage:" --buttons-layout=end --width=650 --multi-progress \
$(df -hT $1 | tail -n +2 | awk '{printf "--bar=\"<b>%s</b> (%s - %s) [%s/%s]\" %s ", $7, $1, $2, $4, $3, $6}')




--bar=LABEL[:TYPE]
Add the progress bar (TYPE - NORM, RTL or PULSE)
--vertical
Show vertical bars
Notification icon options
--command=CMD
Set left-click action
--listen
Listen for commands on stdin
--separator=SEPARATOR
Set separator character for menu values
--item-separator=SEPARATOR
Set separator character for menu items
Print dialog options
yad --print --filename=FILENAME

To print a file called dogs.txt do:

yad --print --filename=/root/dogs.txt

This will invoke the print dialog ready to print the file dogs.txt.




--filename=FILENAME
Source filename to print command.

The yad --print command does nothing alone.

You must add --filename=/PATH/FILENAME

yad --print --filename=/root/dogs.txt

will load the file /root/dogs.txt into the print dialog.



--type=TYPE
Set source type (TYPE - TEXT, IMAGE or RAW)

yad --print --filename=/root/iow.jpg --type=image --preview



--add-preview does not work with --type=raw but it will print.

yad --print --filename=/root/iow.pdf --type=raw



--headers
Add headers to pages.

The following command will add a Preview button to the print dialog, and add a header which will show the path/filename and page number.

yad --print --add-preview --headers --filename=/root/dogs.txt

This is what it looks like when viewed in evince when previewing.



--add-preview
Enable preview in print dialog.

yad --print --add-preview --filename=/root/dogs.txt

Adds a Print Preview button to the print dialog.



--fontname=FONTNAME
Use specified font
Progress options
--progress-text=TEXT
Set progress text
--percentage=PERCENTAGE
Set initial percentage
--pulsate
Pulsate progress bar
--auto-close
Dismiss the dialog when 100% has been reached
--auto-kill
Kill parent process if cancel button is pressed
--rtl
Right-To-Left progress bar direction
Scale options
--value=VALUE
Set initial value
--min-value=VALUE
Set minimum value
--max-value=VALUE
Set maximum value
--step=VALUE
Set step size
--page=VALUE
Set paging size
--print-partial
Print partial values
--hide-value
Hide value
--vertical
Show vertical scale
--invert
Invert direction
--mark=NAME:VALUE
Add mark to scale (may be used multiple times)
Text information options
yad --text-info is used for displaying information.



You will notice there is no =TEXT option.

yad --text-info="Doesn't work"

yad --text-info < /root/my-documents/clipart/README-clipart.txt
does
providing the file "README-clipart.txt" exists.

It reads the information from a file and displays it in the
--text-info box.
--fore=COLOR
Use specified color for text.

You can change the text color by using the --fore command.

yad --text-info --fore=red but you have to generate text to display.

Lets create a simple text file called hello.txt

Inside the text file type "Good morning"

Now read the file into the --text-info dialog like:

yad --text-info --fore=red < hello.txt



You can load quite a large text file and scroll bars will be added when required.
--back=COLOR
Use a specified color for background.

The background colour can also be changed like:

yad --text-info --back=cyan < hello.txt



Now lets try white text on a red background.

yad --text-info --back=red --fore=white < hello.txt





--fontname=FONTNAME
It's also possible to use a different font.

The font must be available, however.

yad --text-info --back=red --fore=white < hello.txt --fontname=Monospace



Now for a few undocumented features.

Lets add italic, size and bold.

yad --text-info --back=red --fore=white < hello.txt --fontname=" Monospace bold italic 20"



Nice....
--wrap
Enable text wrapping.

Create a text file called dogs.txt. In the file type "The quick brown fox jumped over the lazy dogs back."

yad --text-info --wrap < dogs.txt



Notice how the text is wrapped in the dialog box.
--justify=TYPE
Set justification (TYPE = left, right, center or fill)

You can also justify the text. Let's try justifying the text to the right.

yad --text-info --wrap --justify=right < dogs.txt



Now center.

yad --text-info --wrap --justify=center < dogs.txt



Finally, fill.

yad --text-info --wrap --justify=fill < dogs.txt





--margins=SIZE
Set text margins.

yad --text-info --wrap --margins=20 < dogs.txt



I added --wrap so you could see margins on both sides.

--tail
Autoscroll to end of text.

If you load a text file it will scroll through the text to the end of the file.

If it's a long file it will scroll too fast to read it.



It's a handy way to get to the end of a file.
--filename=FILENAME
Open a file in the --text-info dialog.

yad --text-info --filename=/root/hello.txt



yad --text-info < /root/hello.txt will achieve the same result.

Good morning is the contents of the hello.text file.
--editable
Allow changes to the text.

yad --text-info --editable < /root/hello.txt



Now add sunshine after morning.



When you click OK, the following will be displayed:
Good morning sunshine#

Press the Enter key and you will be returned to the prompt.

Now lets make it do something a little more useful.

Write the following script, save it as testedit, then make it executable.

#!/bin/sh
# Created by smokey01

yad --text-info --editable < /root/hello.txt > /root/hello2.txt
rm /root/hello.txt
cp /root/hello2.txt /root/hello.txt
rm /root/hello2.txt

Now run testedit to have some fun.

If you don't want to edit the hello2.txt file just click OK.

If you click Cancel button the text in the file will be removed.

--show-uri
Make URI clickable

Create a file called links.txt in /root

Type http://www.smokey01.com/menu in the file and save the file.

yad --text-info --width=250 < /root/links.txt --show-uri



Now click on the link to go to the website.

Miscellaneous options
--about
yad --about displays the yad about dialog.





--version
yad --version displays the yad version like:
0.27.0
Notebook
Notebook is a complex dialog which swallow other dialogs in his tabs. Dialogs identifies by unique key (integer) and must be runs in a special plug mode (--plug option). Following example runs notebook dialog with two tabs, first has a simple text and second is an entry dialog.

#! /bin/sh
yad --plug=12345 --tabnum=1 --text="first tab with text" &> res1 &yad --plug=12345 --tabnum=2 --text="second tab" --entry &> res2 &yad --notebook --key=12345 --tab="Tab 1" --tab="Tab 2"



GTK+ Options
--class=CLASS
Program class as used by the window manager
--name=NAME
Program name as used by the window manager
--screen=SCREEN
X screen to use
--sync
Make X calls synchronous
--gtk-module=MODULES
Load additional GTK+ modules
--g-fatal-warnings
Make all warnings fatal
Application Options:
--rest=FILENAME
Load extra arguments from file
--calendar
Display calendar dialog
--color
Display color selection dialog
--color-selection
Alias for --color
--dnd
Display drag-n-drop box
--entry
Display text entry or combo-box dialog
--file
Display file selection dialog
--file-selection
Alias for --file
--font
Display font selection dialog
--font-selection
Alias for --font
--form
Display form dialog
--icons
Display icons box dialog
--list
Display list dialog
--multi-progress
Display multi progress bars dialog
--notification
Display notification
--print
Display printing dialog
--progress
Display progress indication dialog
--scale
Display scale dialog
--text-info
Display text information dialog
--display=DISPLAY
X display to use
Examples
EXAMPLES
Display a file selector with the title Select a file to remove. The file selected is returned on standard output.

yad --title="Select a file to remove" --file-selection

Display a text entry dialog with the title Select Host and thetext Select the host you would like to flood-ping. The enteredtext is returned on standard output.

yad --title "Select Host" --entry --text "Select the host you would like to flood-ping"

Display a dialog, asking Microsoft Windows has been found! Wouldyou like to remove it?. The return code will be 0 (true in shell)if YES is selected, and 1 (false) if NO is selected.

yad --image "dialog-question" --title "Alert" --button=gtk-yes:0 --button=gtk-no:1 --text "Microsoft Windows has been found! Would you like to remove it?"

Show the search results in a list dialog with the title Search Resultsand the text Finding all header files....

find . -name '*.h' | yad --list --title "Search Results" --text "Finding all header files.." --column "Files"

Show an icon in the notification area

yad --notification --image=update.png --text "System update necessary!" --command "xterm -e apt-get upgrade"

Display a weekly shopping list in a check list dialog with Apples and Oranges pre selected

yad --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges FALSE Pears FALSE Toothpaste

Display a progress dialog while searching for all the postscript files in your home directory

find $HOME -name '*.ps' | yad --progress --pulsate

A file filter to only select sfs files with multiple select.
yad --title="Select a file to remove" --file-selection --file-filter="*.sfs"


Display a box with all of the installed desktop applications
yad --icons --read-dir=/usr/share/applications


yad --title="SFS Combiner v1" --text-align=center --text "Drag and drop your .sfs files here." --dnd | sed 's/^.......//' > /root/files

Use background and foreground colours, change font and font size.
echo stuff | yad --text-info "Stuff" --fontname="Monospace Italic 30" --fore=red --back=green --justify=left --wrap


yad --text-info --back=red --fore=white < hello.txt --fontname="Monospace bold italic 20"

lxsplit -j file.avi.001 &
while pkill -0 lxsplit; do
echo running
sleep 0.5
done | yad --progress --pulsate --auto-close --auto-kill --button gtk-cancel:1


WD="/mnt/home/create-wd"
mkdir "$WD"


Resources
http://rpm.pbone.net/index.php3/stat/45/idpl/17003956/numer/1/nazwa/yad

http://rpm.pbone.net/index.php3/stat/45/idpl/17320034/numer/1/nazwa/yad

http://rpm.pbone.net/index.php3/stat/45/idpl/20231177/numer/1/nazwa/yad

https://code.google.com/p/yad/w/list

https://code.google.com/p/yad/wiki/Examples

https://code.google.com/p/yad/wiki/NotificationIcon

http://pclosmag.com/html/issues/201201/page12.html

http://sourceforge.net/p/yad-dialog/wiki/Examples/

http://www.murga-linux.com/puppy/viewtopic.php?t=58306

http://gtk-apps.org/content/show.php/YAD?content=116639

https://groups.google.com/forum/#!forum/yad-common

http://thelinuxrain.com/articles/tips-on-getting-and-editing-suggesting-user-input

http://www.thelinuxrain.com/articles/multiple-item-data-entry-with-yad
Variables
Although YAD can produce output from it's many functions, it's a little more challenging
to export this infomation into variables than can be used with external applications.

The following script creates the GUI below.

#!/bin/sh
names=$(echo "Bill,George,Jack,Joe")
occupation=$(echo "Doctor,Dentist,Butcher,Baker,Candlestick Maker,Other")
yad --title="Names" \
--form --separator="," --item-separator="," \
--field="Names:":CB \
--field="Occupation:":CBE \
--field="Comments:":TXT \
"$names" "$occupation" "Type your comments here"



When you run the script and just press OK
you receive the following output when viewing
in a terminal:

Bill,Doctor,Type your comments here,

Below are some solutions provided by rg66 to
export the output of the GUI to variables so they
can be used with external applications.

#!/bin/sh
names=$(echo "Bill,George,Jack,Joe")
occupation=$(echo "Doctor,Dentist,Butcher,Baker,Candlestick Maker,Other")
yad --title="Names" \
--form --separator="," --item-separator="," \
--field="Names:CB" \
--field="Occupation:CBE" \
--field="Comments:TXT" \
"$names" "$occupation" "Type your comments here" | while read line; do
NAME=`echo $line | awk -F',' '{print $1}'`
OCCUPATION=`echo $line | awk -F',' '{print $2}'`
COMMENT=`echo $line | awk -F',' '{print $3}'`

echo "(The selected name) (Selected occupation) (Comments)"
echo
echo
echo $NAME $OCCUPATION $COMMENT
done


Or

#!/bin/sh
names=$(echo "Bill,George,Jack,Joe")
occupation=$(echo "Doctor,Dentist,Butcher,Baker,Candlestick Maker,Other")
yad --title="Names" \
--form --separator="," --item-separator="," \
--field="Names:CB" \
--field="Occupation:CBE" \
--field="Comments:TXT" \
"$names" "$occupation" "Type your comments here" > /tmp/config

NAME=`cat /tmp/config | awk -F',' '{print $1}'`
OCCUPATION=`cat /tmp/config | awk -F',' '{print $2}'`
COMMENT=`cat /tmp/config | awk -F',' '{print $3}'`

#echo $NAME $OCCUPATION $COMMENT #this would have to be run first to work properly with copy/paste into term, in a script it works ok

echo "(The selected name) (Selected occupation) (Comments)"
echo
echo
echo $NAME $OCCUPATION $COMMENT


Or

#!/bin/sh
names=$(echo "Bill,George,Jack,Joe")
occupation=$(echo "Doctor,Dentist,Butcher,Baker,Candlestick Maker,Other")
yad --title="Names" \
--form --separator="," --item-separator="," \
--field="Names:CB" \
--field="Occupation:CBE" \
--field="Comments:TXT" \
"$names" "$occupation" "Type your comments here" | while read line; do
echo "NAME='`echo $line | awk -F',' '{print $1}'`'" > /tmp/config
echo "OCCUPATION='`echo $line | awk -F',' '{print $2}'`'" >> /tmp/config
echo "COMMENT='`echo $line | awk -F',' '{print $3}'`'" >> /tmp/config
done


# other script
#!/bin/sh
. /tmp/config
echo "(The selected name) (Selected occupation) (Comments)"
echo
echo
echo $NAME $OCCUPATION $COMMENT