WITH Gtk.Main ; USE Gtk.Main ;
WITH Gtk.Window ; USE Gtk.Window ;
WITH Gtk.Enums ; USE Gtk.Enums ;
WITH Gtk.Button ; USE Gtk.Button ;
WITH Gtk.Alignment ; USE Gtk.Alignment ;
WITH Gtk.Box ; USE Gtk.Box ;
WITH Gtk.Gentry; USE Gtk.Gentry;
with Ada.text_io;
PROCEDURE prototype IS
-------------------------------
-- VARIABLES -- |
-----------------------------------------------------------
win : Gtk_window ;
Btn1, Btn2 ,Btn3 : Gtk_Button ;
alignG, alignM ,alignD : Gtk_Alignment ;
Boite : Gtk_VBox ;
Boutons : Gtk_HBox ;
space : Gtk_Entry ;
-----------------------------------------------------------
BEGIN
Init ;
--------------------
-- NEW -- |
-------------------------------------------
Gtk_New(win);
Gtk_New(space);
Gtk_New(Btn1, "Bouton 1" ) ;
Gtk_New(Btn2, "Bouton 2" ) ;
Gtk_New(Btn3, "Bouton 3" ) ;
Gtk_New(alignG,0.0,1.0,1.0,1.0);
Gtk_New(alignM,0.5,1.0,1.0,1.0);
Gtk_New(alignD,1.0,1.0,1.0,1.0);
Gtk_New_VBox
(Boite, homogeneous => false, Spacing => 0) ;
Gtk_New_HBox
(Boutons, homogeneous => false, Spacing => 0) ;
--------------------------------------------
Boite.Pack_Start(space);
Boite.Pack_Start(Boutons);
Boutons.Pack_Start(alignG);
Boutons.Pack_Start(alignM);
Boutons.Pack_Start(alignD);
---------------------------------
-- Add |
--------------------------------------------
alignG.add(Btn1) ;
alignM.add(Btn2) ;
alignD.add(Btn3) ;
win.Add(Boite);
-------------------------------------------
win.Set_Default_Size(500,500) ;
win.set_position(Win_Pos_Mouse) ;
-- win.set_opacity(0.7) ;
declare
name : String := get_text(space) ;
begin
if name= "user"
then Ada.text_io.Put("Hello" );
end if;
end ;
win.Show_all ;
Main ;
END prototype ;