Ada and GTK on windows

Ada and GTK+ on windows – hello world sample

Create new project with project wizard.  After initial project creation add project dependency to GtkAda.gpr from “gtk ada” installation folder: \GtkAda\lib\gnat\gtkada.gpr.

2016-08-02 22_11_26-GPS - Project - Gtk2Sample projectOr you can simply open project file (file with ‘gpr’ extension) and add “with”  statement :

“\GtkAda\bin” folder should be in the PATH.

And don’t forget to add special “windows GUI” directives to the linker, go to Project/Properties , under Build/Switches/Ada Linker add this directives in the field :

If you don’t do this, linker will create “windows console application” and additional command line window will always open with your application.

If everything was successful, compile / build will create “main.exe”  program file and if  you run from inside GPS  or from the windows file explorer, only the GTK program window should open.

2016-08-02 22_42_28-GPS - Run_ main - Gtk2Sample projectThis is probably minimal GTK project, perfect to learn Ada with graphical interface.

If you have problems with the installation, please check if everything is installed properly… You can find some hints about installation here.

Leave a Reply

Your email address will not be published.