Code :
procedure Main_Quit(Widget : access Gtk.Widget.Gtk_Widget_Record'class; Main_Window : T_Main_Window) is Dialog : Gtk_Dialog; Yes : Gtk_Widget; No : Gtk_Widget; Help : Gtk_Widget; begin loop Gtk_New(Dialog, "Quit ?", Main_Window.Window, modal); Yes := Add_Button(Dialog, "Yes", Gtk_Response_Yes); Yes := Add_Button(Dialog, "No", Gtk_Response_No); Help := Add_Button(Dialog, "Help", Gtk_Response_Help); case Run(Dialog) is when Gtk_Response_Yes => Gtk.Main.Main_Quit; exit; when Gtk_Response_No => exit; when Gtk_Response_Help => null; when others => null; end case; Destroy(Dialog); end loop; Destroy(Dialog); end Main_Quit;
|