Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Where to find Ada GTK example programs to try?

252 views
Skip to first unread message

Nasser M. Abbasi

unread,
May 7, 2020, 6:21:58 PM5/7/20
to

I'd like to try to make GUI with Ada. I assume the best
choice is to use GTK?

http://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/getting_started.html
http://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/index.html

Any one knows of an actual Ada GUI applications, ready to run,
that I can download, install, and run just to see how they
look and feel?

I googled but not finding any so far. I know there is
also Qt binding for Ada. If one knows of such examples
to download and try, that will be great also.

Thanks
--Nasser

Ludovic Brenta

unread,
May 7, 2020, 7:10:04 PM5/7/20
to
"Nasser M. Abbasi" <n...@12000.org> writes:
> I'd like to try to make GUI with Ada. I assume the best
> choice is to use GTK?
>
> http://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/getting_started.html
> http://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/index.html
>
> Any one knows of an actual Ada GUI applications, ready to run,
> that I can download, install, and run just to see how they
> look and feel?

GtkAda comes with testgtk which is intended both as a test program for
all widgets and as a demo. If you use the Debian package, do

tar xzf /usr/share/doc/libgtkada*-dev/examples/testgtk.tgz

in a source directory that you create.

--
Ludovic Brenta.

Dmitry A. Kazakov

unread,
May 8, 2020, 2:19:10 AM5/8/20
to
On 2020-05-08 00:21, Nasser M. Abbasi wrote:

> Any one knows of an actual Ada GUI applications, ready to run,
> that I can download, install, and run just to see how they
> look and feel?

This application is called GPS!

GTK uses native look and feel, it should look the way a normal Windows,
X11 GUI application looks.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Brian Drummond

unread,
May 8, 2020, 5:52:57 AM5/8/20
to
A while back I put together a little harness intended to help me get
started with features extracted from TestGTK.

Having found something useful (e.g. na example of a scrolling text
window), this harness lets you extract that one feature from testgtk and
build it as a simple standalone application, focussing ONLY on the
selected feature.

It's a starting point for working with it and incorporating it into your
own code.

Probably no interest to experienced Gtkada programmers, but I found it
helpful as a beginner.

https://github.com/Brian-Drummond/testgtk_harness

-- Brian

Nasser M. Abbasi

unread,
May 8, 2020, 4:02:39 PM5/8/20
to
On 5/8/2020 1:19 AM, Dmitry A. Kazakov wrote:
> On 2020-05-08 00:21, Nasser M. Abbasi wrote:
>
>> Any one knows of an actual Ada GUI applications, ready to run,
>> that I can download, install, and run just to see how they
>> look and feel?
>
> This application is called GPS!
>
> GTK uses native look and feel, it should look the way a normal Windows,
> X11 GUI application looks.
>

Yes, I forgot about GPS. I remember reading it used GTK.

But I also remember reading the other day that you said about GPS using
using Python somehow, right?

I have GPS. It is nice. But GTK Ada has been around for long time.

Someone must have written some animations or simulation or game
GUI using Ada-GTK,

That is what I meant. May be you did yourself also, since I know
you are an expert in Ada GTK also.

For example, can one use Ada GTK to make GUI apps like these?

https://www.microsoft.com/en-us/store/collections/game.fc1

I am sure all the above were written in C++ or C#, since
they are from MS store. There are sites like the above
with thousands of apps. I will be nice to have
such examples for ones done using only Ada-GTK.

May be the folks who use Ada all the time prefer to do
serious real-time embedded system program for air traffic
control systems and have no time for making silly GUI apps
in Ada :)

--Nasser

Ludovic Brenta

unread,
May 8, 2020, 5:18:21 PM5/8/20
to
"Nasser M. Abbasi" <n...@12000.org> writes:
> Yes, I forgot about GPS. I remember reading it used GTK.
>
> But I also remember reading the other day that you said about GPS using
> using Python somehow, right?

Yes. GPS uses both GtkAda (for the GUI) and Python (for scripting).

> I have GPS. It is nice. But GTK Ada has been around for long time.

So has GPS.

> Someone must have written some animations or simulation or game
> GUI using Ada-GTK,

Ah, GTK (and GtkAda) is not intended for this. You can write games
using GtkAda but you'd be better off using SDL. There is an Ada binding
at https://github.com/Lucretia/sdlada. While GTK does only graphical
widgets, SDL does accelerated graphics, sound, joystick, etc.

The kind of games that you could make with GTK are desktop games like
the gnome games collection e.g. othello, card cames, chess, etc; not the
ones you refer to.

--
Ludovic Brenta.
The gatekeeper overdelivers our project, while the steering committee focuses on a non-mainstream EBITDA.

Dmitry A. Kazakov

unread,
May 8, 2020, 5:39:40 PM5/8/20
to
On 2020-05-08 22:02, Nasser M. Abbasi wrote:
> On 5/8/2020 1:19 AM, Dmitry A. Kazakov wrote:
>> On 2020-05-08 00:21, Nasser M. Abbasi wrote:
>>
> Yes, I forgot about GPS. I remember reading it used GTK.
>
> But I also remember reading the other day that you said about GPS using
> using Python somehow, right?

It does not use Python for GUI, only for scripting.

> I have GPS. It is nice. But GTK Ada has been around for long time.
>
> Someone must have written some animations or simulation or game
> GUI using Ada-GTK,

GTK is a widget library, it is not purposed for a game engine, like Unreal.

> That is what I meant. May be you did yourself also, since I know
> you are an expert in Ada GTK also.

This one is in GtkAda:

http://www.dmitry-kazakov.de/ada/max_home_automation.htm

> For example, can one use Ada GTK to make GUI apps like these?
>
> https://www.microsoft.com/en-us/store/collections/game.fc1

GTK supports SVG, you can render some 3D stuff, but it is not for that.

> May be the folks who use Ada all the time prefer to do
> serious real-time embedded system program for air traffic
> control systems and have no time for making silly GUI apps
> in Ada :)

I would not classify computer games as GUI. And I would not start doing
this from scratch in a GTK's drawable area! I did some 3D scene
simulation in OpenGL about a quarter of century ago. That was no fun.
Today you will need more than a human life span in order to catch up
with modern 3D engines. Go for a ready to use stuff. Write Ada bindings
if there is no any.

Ludovic Brenta

unread,
May 8, 2020, 8:38:09 PM5/8/20
to
> I would not classify computer games as GUI. And I would not start
> doing this from scratch in a GTK's drawable area! I did some 3D scene
> simulation in OpenGL about a quarter of century ago. That was no
> fun. Today you will need more than a human life span in order to catch
> up with modern 3D engines. Go for a ready to use stuff. Write Ada
> bindings if there is no any.

It is true that writing a high-quality 3D game is not feasible for a
single individual, especially not a beginner. However it is still
possible to write 2D and pseudo-3D games and there are lots of tutorials
to help get started; almost all such games use SDL, so I'd encourage the
OP to look at that.

Like GTK, SDL was written in C for the explicit purpose of facilitating
bindings to higher-level languages and SDL has bindings for Ada and many
other languages. Unfortunately no Ada-specific tutorials but plenty of
Pascal, Python, Lua etc. tutorials.

--
Ludovic Brenta.
The game is all about high quality, stress management, openness,
corporate governance, and white-collar productivity - not evolution,
strategic staircase, cost rationalization, and leadership culture.

Jeffrey R. Carter

unread,
May 9, 2020, 5:47:16 AM5/9/20
to
On 5/8/20 12:21 AM, Nasser M. Abbasi wrote:
>
> I'd like to try to make GUI with Ada. I assume the best
> choice is to use GTK?

It depends on your definition of "best". My experience with the GTKAda version
of Mine_Detector was that pretty much every time there was a new (minor) version
of GTKAda, my code had to change. I have since transitioned it to Gnoga, so I
don't know if that's still the case.

The GTKAda version of Mine_Detector is at

https://github.com/malaise/ada/tree/master/cots/mine

where Pascal Malaise has been keeping it working with recent versions of GTKAda,
and the Gnoga version is at

https://github.com/jrcarter/Mine_Detector

(select the "singleton" branch for a meaningful comparison). The GUI is in pkg
User_IF.

Which you prefer is largely a matter of taste. GTKAda provides your native look
and feel, while Gnoga provides your browser's look and feel; most people are
comfortable with both.

--
Jeff Carter
"You can never forget too much about C++."
115

mgr

unread,
May 9, 2020, 10:59:43 AM5/9/20
to
On 8/5/20 0:21, Nasser M. Abbasi wrote:
> Any one knows of an actual Ada GUI applications, ready to run,
> that I can download, install, and run just to see how they
> look and feel?

You'll find some in github:
https://github.com/topics/gtkada
https://github.com/search?q=gtkada

And in sourceforge (ignore "Learn More" entries):
https://sourceforge.net/directory/os:linux/?q=gtkada

Optikos

unread,
May 10, 2020, 3:40:05 PM5/10/20
to
On Friday, May 8, 2020 at 3:02:39 PM UTC-5, Nasser M. Abbasi wrote:
> On 5/8/2020 1:19 AM, Dmitry A. Kazakov wrote:
> > On 2020-05-08 00:21, Nasser M. Abbasi wrote:
> >
> >> Any one knows of an actual Ada GUI applications, ready to run,
> >> that I can download, install, and run just to see how they
> >> look and feel?
> >
> > This application is called GPS!
> >
> > GTK uses native look and feel, it should look the way a normal Windows,
> > X11 GUI application looks.
> >
>
> Yes, I forgot about GPS. I remember reading it used GTK.
>
> But I also remember reading the other day that you said about GPS using
> using Python somehow, right?
>
> I have GPS. It is nice. But GTK Ada has been around for long time.
>
> Someone must have written some animations or simulation or game
> GUI using Ada-GTK,

The Ada community needs a physics engine on top of which to build state-of-the-art games. Either a binding or better yet a port or fresh design entirely in Ada2012 or Ada2020. The benefit of a physics engine would have applicability to Ada's core mission of realtime embedded systems (even for military usage) far beyond gaming.

https://en.wikipedia.org/wiki/Physics_engine
0 new messages