## gdialog Manual

2001
Patanjali Somayaji

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found here.

Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any GNOME documentation, and those trademarks are made aware to the members of the GNOME Documentation Project, the names have been printed in caps or initial caps.

This is version 0.1 of the GDialog manual.

## Introduction

gdialog is a command prompt application which displays GNOME dialog boxes. It is meant to be used as a quick way to display dialog boxes within shell scripts.

gdialog helps you to create small and useful commonly used dialog boxes, like message boxes, information boxes, input boxes, etc.

gdialog is included in the `gnome-utils` package, which is part of the GNOME desktop environment. This document describes version &version; of gdialog.

## Using gdialog

### Basic usage

gdialog is a utility meant for use in shell scripts or from the command prompt. Hence, to run gdialog, the complete description needs to be given on the command line or in the shell script about the type of dialog box to be created and shown to the user. For example, type the following in a GNOME terminal, or put it in a shell script - `gdialog --msgbox "Here's a test message !" 200 150` creates and displays the dialog box shown in .

#### gdialog example

gdialog msgbox example

The complete command line options list for gdialog is

`gdialog [--title <title>] [--separate-output] [--backtitle >backtitle>] [--clear] <Box options>`

`title` is used to give a title to the dialog.

"Box Options" can be one of the following

- `[--defaultno] --yesno <text> <height> <width>`

- `--msgbox <text> <height> <width>`

- `--infobox <text> <height> <width>`

- `--inputbox <text> <height> <width> [<init>]`

- `--textbox <file> <height> <width>`

- `--menu <text> <height> <width> <menu height> <tag1> <item1> ...`

- `--checklist <text> <height> <width> <list height> <tag1> <item1> <status1> ...`

- `--radiolist <text> <height> <width> <list height> <tag1> <item1> <status1> ...`

- `--gauge <text> <height> <width> <percent>`

- `--guage <file> <text> <height> <width> <percent>`

Using gdialog to show different types of dialog shown above is explained in the following sections.

## Using different tyes of dialog boxes

This section shows you how to create and display different types of dialogs. For all the examples, we'll be using a width of 250 and a height of 150 in place of `<width>` and `<height>` for the width and height of the dialog box to be displayed.

### Creating a Confirmation Dialog

You can create a dialog box that shows a question and a "Yes" and a "No" button using the `--yesno` option. For example, to create a dialog box with the title as "My Dialog", and question to be shown "Should I exit ?" use the following command `gdialog --title "My Dialog" --yesno "Should I exit ?" 250 150`

The above command displays the dialog box shown in figure .

#### confirmation box example

gdialog confirmation box example

The return value from gdialog is 0 if the user clicked on "Yes" and 1 if the user clicked on "No". By default, the "Yes" button is highlighted when the dialog is displayed. In case you want the "No" button to be highlighted, add `--defaultno`

### Creating a Message Box

You can create a dialog box that shows a message using the `--msgbox` option. For example, to create a dialog box with the title as "My Dialog", and message to be shown "Here's a message !" use the following command `gdialog --title "My Dialog" --msgbox "Here's a message" 250 150`

The above command displays the dialog box shown in figure .

#### Message box example

gdialog message box example

## Known Bugs and Limitations

This application has no known bugs.

## Authors

gdialog was written by Savio Lam (lam836@cs.cuhk.hk) and Stuart Herbert (S.Herbert@shef.ac.uk). Please send all comments, suggestions, and bug reports to the GNOME bug tracking database. (Instructions for submitting bug reports can be found on-line.) You can also use Bug Report Tool (`bug-buddy`), available in the Utilities submenu of Main Menu, for submitting bug reports.

This manual was written by Patanjali Somayaji (patanjali@morelinux.com). Please send all comments and suggestions regarding this manual to the GNOME Documentation Project by sending an email to docs@gnome.org. You can also add your comments online by using the GNOME Documentation Status Table.

## License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License is included as an appendix to the GNOME Users Guide. You may also obtain a copy of the GNU General Public License from the Free Software Foundation by visiting their Web site or by writing to

        Free Software Foundation, Inc.
        59 Temple Place - Suite 330
        Boston, MA 02111-1307
        USA