package Implements_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Dialog_Record, Gtk_Dialog);
type Gtk_Dialog_Record is new Gtk_Window_Record with null record;
type Gtk_Dialog is access all Gtk_Dialog_Record'Class;
type Gtk_Response_Type is new Gint;
type Response_Type_Array is array (Natural range <>) of Gtk_Response_Type;
Modal : constant Gtk_Dialog_Flags := 2 ** 0;
Destroy_With_Parent : constant Gtk_Dialog_Flags := 2 ** 1;
No_Separator : constant Gtk_Dialog_Flags := 2 ** 2;
Gtk_Response_None : constant Gtk_Response_Type := -1;
Gtk_Response_Reject : constant Gtk_Response_Type := -2;
Gtk_Response_Accept : constant Gtk_Response_Type := -3;
Gtk_Response_Delete_Event : constant Gtk_Response_Type := -4;
Gtk_Response_OK : constant Gtk_Response_Type := -5;
Gtk_Response_Cancel : constant Gtk_Response_Type := -6;
Gtk_Response_Close : constant Gtk_Response_Type := -7;
Gtk_Response_Yes : constant Gtk_Response_Type := -8;
Gtk_Response_No : constant Gtk_Response_Type := -9;
Gtk_Response_Apply : constant Gtk_Response_Type := -10;
Gtk_Response_Help : constant Gtk_Response_Type := -11;
Has_Separator_Property : constant Glib.Properties.Property_Boolean;
Signal_Close : constant Glib.Signal_Name := "close";
Signal_Response : constant Glib.Signal_Name := "response";
procedure Gtk_New
( | Dialog | : out Gtk_Dialog); |
procedure Initialize
( | Dialog | : access Gtk_Dialog_Record'Class); |
procedure Gtk_New
( | Dialog | : out Gtk_Dialog; |
Title | : UTF8_String; | |
Parent | : Gtk.Window.Gtk_Window := null; | |
Flags | : Gtk_Dialog_Flags); |
procedure Initialize
( | Dialog | : access Gtk_Dialog_Record'Class; |
Title | : UTF8_String; | |
Parent | : Gtk.Window.Gtk_Window := null; | |
Flags | : Gtk_Dialog_Flags); |
function Get_Type return Glib.GType;
procedure Add_Action_Widget
( | Dialog | : access Gtk_Dialog_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Response_Id | : Gtk_Response_Type); |
function Add_Button
( | Dialog | : access Gtk_Dialog_Record; |
Text | : UTF8_String; | |
Response_Id | : Gtk_Response_Type) return Gtk.Widget.Gtk_Widget; |
function Get_Action_Area
( | Dialog | : access Gtk_Dialog_Record) return Gtk.Box.Gtk_Box; |
function Get_Content_Area
( | Dialog | : access Gtk_Dialog_Record) return Gtk.Box.Gtk_Box; |
function Get_Has_Separator
( | Dialog | : access Gtk_Dialog_Record) return Boolean; |
procedure Set_Has_Separator
( | Dialog | : access Gtk_Dialog_Record; |
Setting | : Boolean); |
function Get_Response_For_Widget
( | Dialog | : access Gtk_Dialog_Record; |
Widget | : access Gtk.Widget.Gtk_Widget_Record'Class) return Gtk_Response_Type; |
function Get_Widget_For_Response
( | Dialog | : access Gtk_Dialog_Record; |
Response_Id | : Gtk_Response_Type) return Gtk.Widget.Gtk_Widget; |
procedure Response
( | Dialog | : access Gtk_Dialog_Record; |
Response_Id | : Gtk_Response_Type); |
function Run
( | Dialog | : access Gtk_Dialog_Record) return Gtk_Response_Type; |
procedure Set_Default_Response
( | Dialog | : access Gtk_Dialog_Record; |
Response_Id | : Gtk_Response_Type); |
procedure Set_Response_Sensitive
( | Dialog | : access Gtk_Dialog_Record; |
Response_Id | : Gtk_Response_Type; | |
Setting | : Boolean); |
procedure Set_Alternative_Button_Order_From_Array
( | Dialog | : access Gtk_Dialog_Record; |
New_Order | : Response_Type_Array); |
function Gtk_Alternative_Dialog_Button_Order
( | Screen | : Gdk.Gdk_Screen := null) return Boolean; |
function Get_Vbox
( | Dialog | : access Gtk_Dialog_Record) return Gtk.Box.Gtk_Box; |
function "+"
( | Widget | : access Gtk_Dialog_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Dialog renames Implements_Buildable.To_Object; |
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 Gtkada.Dialogs for a higher level dialog interface.