6 Actions

When the user changes the state of a widget, gtkdialog checks if there is something to do with it. If the tampered widget have one or more actions, the program will execute them for the new situation to be handled.

Every widget can have multiply actions, a list of commands must be executed when the widget changed. Gtkdialog executes the axtions in the order they found in the dialog description program, so one can write a complet program as a series of instructions.

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.

6.2 Widget manipulation

6.2.1 'Closewindow:NAME'

The command closes the named window opened by the 'Launch:' command. The program remain active if there are more windows active.

6.2.2 'Launch:NAME'

The command opens a new window using the environment variable 'Widget'.

6.2.3 'Disable:NAME'

The command disables the given widget if it is enabled. If the widget is disabled when the command is activated, nothing happens.

The disabled widgets are insensitive to user actions, their shapes are indicating they are temporary unavailable.

6.2.4 'Enable:NAME'

The command enables the given widget if it is diabled. If the widget is enabled nothing happens.

6.2.5 'Refresh:NAME'

The command refresh the named widget. If the widget have one or more input actions, they will be called by 'gtkdialog'.

6.2.6 'Save:NAME'

Some widgets can hold much data. (Currently only the edit widget capable to perform this action.)

The 'Save:' action will save the data found in the named widget to the filename found in '<output file>' attribute.

FIXME: This function is not working now, need to be fixed.

6.2.7 'Fileselect:WIDGET'

Empty.

6.2.8 'Clear:WIDGET'

Empty.

6.2.9 'RemoveSelected:WIDGET'

Empty.

documented on: 2008-07-05