A popup window.

Object Hierarchy

`-- GtkObject
       `-- GtkWidget
              `-- GtkContainer
                     `-- GtkBin
                            `-- GtkWindow
                                   `-- GtkDialog

Direct Subclasses


As the name suggests, GtkDialog is a widget that is useful whenever you want to interact with the user. For example, you might want to ask the user a question, prompt for certain input, or confirm some action. The GtkDialog helps in such cases by providing a suitable window for interaction. Don't be fooled by the simple example, a GtkDialog can do much more powerful things than what is shown!

A GtkDialog is basically made up of two main areas, the top area, where you may pack widgets like GtkLabel or a GtkEntry. The bottom area may be used to display GtkButtons that will perform some action, like OK or cancel. The bottom area of the dialog is known as the action_area, while the top area is a vbox.

The general procedure for creating a dialog box would be to create a Dialog Box with its constructor and then adding the appropriate widgets to the vbox and action_area. Alternatively, instead of adding the required buttons to the action_area, you may make use of the add_button() method. The advantage of this method is that you get to choose a response signal. You may choose a response ID from GtkResponseType, that suits the purpose of your button. The third and most convenient way to add buttons to the dialog is passing them as parameters while using the constructor.

Most of the time however, you do not have to go through all this trouble unless you want to create a highly customized dialog. The common types of dialog boxes have widgets of their own, like the GtkFileChooserDialog or the GtkColorSelectionDialog.


GtkDialog ([string title = null [, GtkWidget parent_window = null [, GtkDialogFlags dialog_flags = 0 [, array (GtkButton, GtkResponseType)]]]]);

-- Creates a new dialog box.


  Add a widget to the action_area
  Adds a button to the dialog.
  Adds an array of buttons to the dialog.
  Returns whether the dialog has a separator.
  Emits the response signal.
  Blocks the main loop until the dialog is destroyed.
  Sets the response ID to be generated by the dialog.
  Sets whether the dialog has a separator.
  Sets the activatable widgets to be sensitive or not.


  Describes the area of the dialog that holds the action widgets (buttons).
  Describes the area of the dialog that holds the prompt widgets (labels).


  Emitted when the dialog is destroyed.
  Emitted when an action widget (button) is clicked.