# Discussions about GUI design in Ada

**URL:** https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265
**Category:** General
**Created:** [March 16, 2026, 10:30pm UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265 "2026-03-16T22:30:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![F-Loyer](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/f-loyer/32/531_2.png) [@F-Loyer](https://forum.ada-lang.io/u/F-Loyer)
#### Post date: [March 16, 2026, 10:30pm UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/1 "2026-03-16T22:30:35Z")

</div>

I don’t see how it could work.

If you create a button (a function will return a button structure you can use to change the colours, text and other things). But how will you link the button with a given task. ? I guess that in Ada we can only call a task service with:

```ada
The_Task.Service_Name(arguments);

```

And here, `The_Task` is a static name, and not a variable given to the button initialisation functions.

However, you can call `Set_callback(A_Button, A_Callback’access);`, I know no équivalent with tasks.

And nothing prevents you to have a callback based GUI library and use callbacks that call a task service. Idem with an object based library.

---

<div class="post-metadata">

### Author: ![dmitry-kazakov](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/dmitry-kazakov/32/522_2.png) [@dmitry-kazakov](https://forum.ada-lang.io/u/dmitry-kazakov)
#### Post date: [March 17, 2026, 9:55am UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/2 "2026-03-17T09:55:00Z")

</div>

I think you are talking different things. An implementation of event posting (however in a GUI many events are processed synchronously, e.g. programmatically emitted events, rather than input ones) is a very low-level thing hidden by the framework in a messages loop and translated into a higher level primitive operations (methods/callbacks) of the widgets. If the proposal is to sit in the basement rather than to go to at least the first floor that would be indeed awful, but it is unclear if that is the proposal. There is nothing static in

` Messages_Handler.Send (Button, Click_Event);`

Messages\_Handler can be a task object.

The architectural GUI problem of widget hierarchy is that while it, augmented by aggregation/composition (container widgets), reflects our understanding of GUI, it puts event handing upside down when a button sends “clicked” to itself. The actual recipient must catch it by connecting handlers/callbacks, whatever. So while the visual aspect is nicely represented the functional logic is a hodge-podge of assorted unstructured subroutines chaotically distributed all over the application.

A solution must address this in the first place. IMO. If not, GtkAda will serve you well.

---

<div class="post-metadata">

### Author: ![JC001](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@JC001](https://forum.ada-lang.io/u/JC001)
#### Post date: [March 17, 2026, 9:58am UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/3 "2026-03-17T09:58:18Z")

</div>

> [@F-Loyer](#):
>
> But how will you link the button with a given task. ?

Ada GUI does not link widgets with anything. I suggest you read the package specification and some of the test/demo programs.

---

<div class="post-metadata">

### Author: ![dmitry-kazakov](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/dmitry-kazakov/32/522_2.png) [@dmitry-kazakov](https://forum.ada-lang.io/u/dmitry-kazakov)
#### Post date: [March 17, 2026, 10:16am UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/4 "2026-03-17T10:16:48Z")

</div>

Let me just name a few road blocks from the language perspective:

1. Stateful co-routines (lack of). We do not want have a task per widget. There should be close to zero cost tasks having same interface as full tasks.

2. Multiple dispatch or alike (lack of). There is a sender and receiver in each GUI action (e.g.

3. Delegation (you want events propagate from members of a container up to the container). Again, in a structured safe and typed manner.

---

<div class="post-metadata">

### Author: ![liampwll](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/l/b19c9b/32.png) [@liampwll](https://forum.ada-lang.io/u/liampwll)
#### Post date: [March 17, 2026, 11:18am UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/5 "2026-03-17T11:18:36Z")

</div>

> [@F-Loyer](#):
>
> However, you can call `Set_callback(A_Button, A_Callback’access);`, I know no équivalent with tasks.

Regarding this particular bit: A task can implement a limited, synchronized, or task interface which you can then pass around a class-wide access type of.

---

<div class="post-metadata">

### Author: ![dmitry-kazakov](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/dmitry-kazakov/32/522_2.png) [@dmitry-kazakov](https://forum.ada-lang.io/u/dmitry-kazakov)
#### Post date: [March 17, 2026, 11:30am UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/6 "2026-03-17T11:30:59Z")

</div>

There is no full multiple-inheritance in Ada. Therefore you cannot have a partially implemented interface as required for processing event where you filter out some event and let propagate others. You can do this in Ada with tagged types, but that hierarchy is already occupied by the widgets and there is no place left to the hierarchy of events.

There are OO patterns to deal with this, all resulting in quite complicated designs.

---

<div class="post-metadata">

### Author: ![Irvise](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/i/7ba0ec/32.png) [@Irvise](https://forum.ada-lang.io/u/Irvise)
#### Post date: [March 17, 2026, 8:32pm UTC](https://forum.ada-lang.io/t/discussions-about-gui-design-in-ada/4265/7 "2026-03-17T20:32:12Z")

</div>

Hi all,

I moved the discussion to a separate thread so as to keep the Project Ideas discussion only related to the idea itself and what is being proposed. This will help the Awards people to read the relevant posts about the idea itself.

Nevertheless, feel free to continue the topic here or suggest a better title for the thread, I didn’t really know how to make it more accurate.

Best regards,  
Fer
