Next: Widget manipulation, Up: Actions [Contents]

### 6.1 Start and exit

#### 6.1.1 Start programs

If the action of a widget is created with the simple `<action>command</action>` directive, gtkdialog will execute it in a subshell. That means it will start up `/bin/sh` to handle the operation. Here is how the subshell operation works:

1. First gtkdialog updates the environment variables holds the state and value of the widgets. This is how the child process will know what is happening in the GUI called it.
2. Next the include file is checked. If the gtkdialog started with the `-i file` option gtkdialog will ask the subshell to include the file before the execution of command.

   This strange method is needed for the action driven programs, where the subshell have to load the shell functions from the calling script.

3. At the third step gtkdialog starts the command and waits for it to complete. (Commands usually can be run in the background by writing a `&` as last character, so the subshell will not wait the program to complete.)

#### 6.1.2 Exit dialog

The `Exit:Value` command exits `gtkdialog` immediately. The Value will be printed to standard output as the value of the variable named EXIT.