1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
.. _Starting_an_application_with_GtkAda:
***********************************
Starting an application with GtkAda
***********************************
You need to perform some initializations to start a GtkAda application::
-- predefined units of the library
with Gtk.Main;
with Gtk.Enums;
with Gtk.Window;
...
-- My units
with Callbacks;
...
procedure Application is
procedure Create_Window is ...
begin
-- Set the locale specific datas (e.g time and date format)
Gtk.Main.Set_Locale;
-- Initializes GtkAda
Gtk.Main.Init;
-- Create the main window
Create_Window;
-- Signal handling loop
Gtk.Main.Main;
end Application;
the `Create_Window` procedure looks like::
procedure Create_Window is
Main_Window : Gtk.Window.Gtk_Window;
...
begin
Gtk.Window.Gtk_New
(Window => Main_Window,
The_Type => Gtk.Enums.Window_Toplevel);
-- From Gtk.Widget:
Gtk.Window.Set_Title (Window => Main_Window, Title => "Editor");
-- Construct the window and connect various callbacks
...
Gtk.Window.Show_All (Main_Window);
end Create_Window;
|