Running “about” from testgtk via Alire
Minimal Setup: Run testgtk “Base widgets” – “about dialog” with Alire
Date: June 28 2025
Confirmed versions:
Ubuntu: 24.04.2 LTS, Gnat: 14.2.1, Gtkada:25.0.1
PC: OMEN 17-ck2095cl, i9-13900HX, RTX-4080
Setup Build Space “about” for “create_about”
testgtk sample project name: create_about
New directory name: about
~$ mkdir ada/s_testgtk
~$ cd ada/s_testgtkStartup GnatStudio with Alire
~/ada/s_testgtk$ alr init about –bin
Alire needs some user information to initialize the crate author and maintainer,
for eventual submission to the Alire community index. This information will be
interactively requested now.
You can edit this information at any time with ‘alr config’
Enter a short description of the crate: (default: ”)
> Press Enter
Using default: ”
Please enter your email address: (default: ‘example@example.com’)
> Press Enter
Using default: ‘example@example.com‘
Select a software license for the crate?
1. MIT OR Apache-2.0 WITH LLVM-exception
2. MIT
3. Apache-2.0 WITH LLVM-exception
4. Apache-2.0
5. BSD-3-Clause
6. LGPL-3.0-or-later
7. GPL-3.0-or-later WITH GCC-exception-3.1
8. GPL-3.0-or-later
9. Other…
Enter your choice index (#1 is default):
> Press Enter
Enter a comma (‘,’) separated list of tags to help people find your crate: (default: ”)
> Press Enter
Using default: ”
Enter an optional Website URL for the crate: (default: ”)
Setup gtkada Environment
> Press Enter
Using default: ”
✓ about initialized successfully.
~/ada/s_testgtk$ cd about
/ada/s_testgtk/about$ alr with gtkada
◴ Updating index... remote: Enumerating objects: 126, done.
remote: Counting objects: 100% (99/99), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 126 (delta 57), reused 77 (delta 48), pack-reused 27 (from 1)
Receiving objects: 100% (126/126), 47.03 KiB | 3.62 MiB/s, done.
Resolving deltas: 100% (61/61), completed with 17 local objects.
From https://github.com/alire-project/alire-index
4f64614..f814b95 stable-1.3.0 -> origin/stable-1.3.0
01882d3..c8f57b5 stable-1.4.0 -> origin/stable-1.4.0
Updating 4f64614..f814b95
Fast-forward
index/pr/press_utils/press_utils-1.0.0.toml | 15 +++++++++++++++
.../sparkfun_qwiic_motor_driver-0.1.0.toml | 19 +++++++++++++++++++
2 files changed, 34 insertions(+)
create mode 100644 index/pr/press_utils/press_utils-1.0.0.toml
create mode 100644 index/sp/sparkfun_qwiic_motor_driver/sparkfun_qwiic_motor_driver-0.1.0.toml
◵ Solving dependencies: 0/0/0/6 (complete/partial/dupes/states)... Looking for e. ◵ Solving dependencies: 0/0/0/6 (complete/partial/dupes/states)... Looking for e. ◵ Solving dependencies: 0/0/0/6 (complete/partial/dupes/states)... Looking for e. ◵ Solving dependencies: 0/0/0/6 (complete/partial/dupes/states)... Looking for e. ◵ Solving dependencies: 0/0/0/6 (complete/partial/dupes/states)... Looking for e. ◵ Solving dependencies: 0/0/0/6 (complete/partial/dupes/states)... Looking for e. Requested changes:
✓ gtkada ^25.0.1 (add)
Changes to dependency solution:
+ gtkada 25.0.1 (new)
+📦 libgtk3 3.24.41 (new,indirect,system package)
+📦 make 4.3.0 (new,indirect,system package)
+📦 pkg_config 1.8.1 (new,indirect,system package)
Do you want to proceed?
[Y] Yes [N] No (default is Yes) <strong>Yes</strong>
~/ada/s_testgtk/about$ alr build
ⓘ Building about=0.1.0-dev/about.gpr…
Setup
[mkdir] object directory for project About
[mkdir] exec directory for project About
Compile
[Ada] about.adb
Bind
[gprbind] about.bexch
[Ada] about.ali
Link
[link] about.adb
✓ Build finished successfully in 0.40 seconds.
~/ada/s_testgtk/about$ ls -al
total 44
drwxrwxr-x 8 mm mm 4096 Jun 14 17:58 .
drwxrwxr-x 3 mm mm 4096 Jun 14 17:55 ..
-rw-rw-r– 1 mm mm 558 Jun 14 17:55 about.gpr
drwxrwxr-x 3 mm mm 4096 Jun 14 17:58 alire
-rw-rw-r– 1 mm mm 286 Jun 14 17:56 alire.toml
drwxrwxr-x 2 mm mm 4096 Jun 14 17:58 bin
drwxrwxr-x 2 mm mm 4096 Jun 14 17:55 config
-rw-rw-r– 1 mm mm 29 Jun 14 17:55 .gitignore
drwxrwxr-x 3 mm mm 4096 Jun 14 17:58 obj
drwxrwxr-x 3 mm mm 4096 Jun 14 17:55 share
drwxrwxr-x 2 mm mm 4096 Jun 14 17:55 src
Copy 2 files from the testgtk directory into src directory.
https://github.com/AdaCore/gtkada/tree/master/testgtk
create_about.ads, creat_about.adb
~/ada/s_testgtk/about$ cd src
~/ada/s_testgtk/about/src$ ls -al
total 40
drwxrwxr-x 2 mm mm 4096 Jun 14 18:00 .
drwxrwxr-x 8 mm mm 4096 Jun 14 17:58 ..
-rw-rw-r– 1 mm mm 45 Jun 14 17:55 about.adb
-rw-rw-r– 1 mm mm 5413 Jun 14 17:18 create_about.adb
-rw-rw-r– 1 mm mm 1900 Jun 14 17:23 create_about.ads
Edit Source Files
about.adb is auto-created file
~/ada/s_testgtk/about/src$ cat about.adb
procedure About is
begin
null;
end About;
Edit main program about.adb
with Gdk.Event; -- use Gdk.Event;
-- with label; use Label;
-- with Gdk; use Gdk;
with Gtk.Box; use Gtk.Box;
with Gtk.Widget; use Gtk.Widget;
with Gtk.Main;
with Gtk.Window; use Gtk.Window;
-- ****** Add DEFINITION ***********
with Gtk.Frame; use Gtk.Frame;
– with Common; use Common;
with Create_About; -- use Create_About;
-- **********************************
procedure About is
Win : Gtk_Window;
Box : Gtk_Vbox;
Frame1 : Gtk_Frame; -- ****** ADD DEFINITION
function Delete_Event_Cb
(Self : access Gtk_Widget_Record'Class;
Event : Gdk.Event.Gdk_Event)
return Boolean;
---------------------
-- Delete_Event_Cb --
---------------------
function Delete_Event_Cb
(Self : access Gtk_Widget_Record'Class;
Event : Gdk.Event.Gdk_Event)
return Boolean
is
pragma Unreferenced (Self, Event);
begin
-- Close all child windows before closing main loop
Win.Destroy;
Gtk.Main.Main_Quit;
return True;
end Delete_Event_Cb;
---- Main Program ---------------------
begin
-- Initialize GtkAda.
Gtk.Main.Init;
-- Create a window with a size of 400x400
Gtk_New (Win);
Win.Set_Default_Size (400, 400);
-- Create a box to organize vertically the contents of the window
Gtk_New_Vbox (Box);
Win.Add (Box);
Gtk.Frame.Gtk_New (Frame1);
Add (Box, Frame1);
Create_About.Run (Frame1); -- **** CALL Package.Procedure *******
-- Stop the Gtk process when closing the window
Win.On_Delete_Event (Delete_Event_Cb'Unrestricted_Access);
-- Show the window and present it
Win.Show_All;
Win.Present;
-- Start the Gtk+ main loop
Gtk.Main.Main;
end About;
Startup GnatStudio with Alire
~/ada/s_testgtk/about$ alr edit
Change Project file (gpr)
File about.gpr opens as above screen automatically.
File about.gpr before modification:
with "config/about_config.gpr";
project About is
for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & About_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Exec_Dir use "bin";
for Main use ("about.adb");
package Compiler is
for Default_Switches ("Ada") use About_Config.Ada_Compiler_Switches;
end Compiler;
package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;
package Install is
for Artifacts (".") use ("share");
end Install;
end About;
Modify about.gpr.
Add the following line at the next of “for Main use (“about.adb”);
for Source_Files use (“create_about.adb”, “create_about.ads”, “about.adb”);
File about.gpr after the modification
with "config/about_config.gpr";
project About is
for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & About_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Exec_Dir use "bin";
for Main use ("about.adb");
for Source_Files use ("common.adb", "common.ads", "create_about.adb", "create_about.ads", "about.adb");
package Compiler is
for Default_Switches ("Ada") use About_Config.Ada_Compiler_Switches;
end Compiler;
package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;
package Install is
for Artifacts (".") use ("share");
end Install;
end About;
Build
Build message
gprbuild -d -P/home/mm/ada/s_testgtk/about/about.gpr -XLIBRARY_TYPE=static -XBUILD=Production -XGTK_PREFIX=/home/mm/.local/share/alire/builds/gtkada_25.0.1_d3787772/05561da954afaee17128f59bba699db2f2e4a4215317b2b818a8016192c82334/ -XOBJCFLAGS= -XLDFLAGS= -XCPPFLAGS= -XCFLAGS= -XADAFLAGS=
Compile
[Ada] about.adb
Bind
[gprbind] about.bexch
[Ada] about.ali
Link
[link] about.adb
[2025-06-17 15:05:43] process terminated successfully, elapsed time: 00.89s
Execution
Execution must be done in Terminal mode.
~/ada/s_testgtk/about/bin$ ./about
The following screenshot remains when closing “about” popup.
It needs to press “X” on the top right corner to close it.