A popup window.
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
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
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
Creates a new dialog box.
Describes the area of the dialog that holds the action widgets
Describes the area of the dialog that holds the prompt widgets
Emitted when the dialog is destroyed.
Emitted when an action widget (button) is clicked.