Dialog boxes are a convenient way to prompt the user for a small amount of input, eg. to display a message, ask a question, or anything else that does not require extensive effort on the user's part.
Gtkada treats a dialog as a window split horizontally. The top section is a Gtk_Vbox, and is where widgets such as a Gtk_Label or a Gtk_Entry should be packed. The second area is known as the action_area. This is generally used for packing buttons into the dialog which may perform functions such as cancel, ok, or apply. The two areas are separated by a Gtk_Hseparator.
If 'dialog' is a newly created dialog, the two primary areas of the window can be accessed using Get_Vbox and Get_Action_Area as can be seen from the example, below.
A 'modal' dialog (that is, one which freezes the rest of the application from user input), can be created by calling Set_Modal on the dialog.
see section Package Gtkada.Dialogs for a higher level dialog interface.
Widget Hierarchy |
---|
Gtk_Object (see section Package Gtk.Object) \___ Gtk_Widget (see section Package Gtk.Widget) \___ Gtk_Container (see section Package Gtk.Container) \___ Gtk_Bin (see section Package Gtk.Bin) \___ Gtk_Window (see section Package Gtk.Window) \___ Gtk_Dialog (see section Package Gtk.Dialog) |
Subprograms |
---|
procedure Gtk_New (Dialog : out Gtk_Dialog); | ||
Create a new dialog. | ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Dialog.
| ||
function Get_Action_Area (Dialog : access Gtk_Dialog_Record) return Gtk.Box.Gtk_Box; | ||
Return the action area box associated with a Dialog.
| ||
function Get_Vbox (Dialog : access Gtk_Dialog_Record) return Gtk.Box.Gtk_Box; | ||
Return the vertical box associated with a Dialog.
|