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

GtkAda on macOS Big Sur

195 views
Skip to first unread message

Gareth Baker

unread,
Aug 21, 2021, 10:28:31 AM8/21/21
to
I hope someone can help - I've used GtkAda before with no problems (AdaCore CE and Xnadalib) but I'm now getting an odd behaviour. Using the recent Ce-2021 versions (and actually all other previous versions back to 2019). The programs compile okay but when launched they appear as a small rectangle (top left quarter) within a larger window with a black background.

Am I missing some setting that not mentioned in the README(s)?

Thanks
Gareth

Dmitry A. Kazakov

unread,
Aug 21, 2021, 10:47:29 AM8/21/21
to
On 2021-08-21 16:28, Gareth Baker wrote:
> I hope someone can help - I've used GtkAda before with no problems (AdaCore CE and Xnadalib) but I'm now getting an odd behaviour. Using the recent Ce-2021 versions (and actually all other previous versions back to 2019). The programs compile okay but when launched they appear as a small rectangle (top left quarter) within a larger window with a black background.
>
> Am I missing some setting that not mentioned in the README(s)?

Hmm, a console application? Do you have the linker switch -mwindows on?

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

Gareth Baker

unread,
Aug 21, 2021, 11:15:40 AM8/21/21
to
No it should be the basic one window with 'Hello World' label in the middle. It's launched from the terminal (zsh).

Thanks
Gareth

Jeffrey R. Carter

unread,
Aug 21, 2021, 12:04:28 PM8/21/21
to
On 8/21/21 4:28 PM, Gareth Baker wrote:
> I hope someone can help - I've used GtkAda before with no problems (AdaCore CE and Xnadalib) but I'm now getting an odd behaviour.
What did you use the last time it worked?

--
Jeff Carter
"Write clearly--don't sacrifice clarity for 'efficiency.'"
Elements of Programming Style
186

Gareth Baker

unread,
Aug 21, 2021, 12:11:27 PM8/21/21
to
Hi,

I took my versions of the compiler and XNAdaLib back to ones that I had working but got the same behaviour. The only difference being I am now on Big Sur.

Thanks
Gareth

Jeffrey R. Carter

unread,
Aug 22, 2021, 5:14:10 AM8/22/21
to
On 8/21/21 6:11 PM, Gareth Baker wrote:
>
> I took my versions of the compiler and XNAdaLib back to ones that I had working but got the same behaviour. The only difference being I am now on Big Sur.

It sounds as if the OS version changed something. You might want to consider a
less OS-dependent GUI library, such as Ada GUI
(https://github.com/jrcarter/Ada_GUI) or Gnoga
(https://sourceforge.net/projects/gnoga/).

--
Jeff Carter
"Nobody expects the Spanish Inquisition!"
Monty Python's Flying Circus
22

Gareth Baker

unread,
Aug 22, 2021, 1:23:22 PM8/22/21
to
Jeff,

Thanks for the pointers, I'll try them.

Gareth

Stéphane Rivière

unread,
Aug 23, 2021, 6:05:27 AM8/23/21
to
>> less OS-dependent GUI library, such as Ada GUI
>> (https://github.com/jrcarter/Ada_GUI) or Gnoga

This is an interesting derivative I was not aware of...
I'll give it a try,

Thanks Jeff...

DrPi

unread,
Aug 23, 2021, 9:14:52 AM8/23/21
to
Le 22/08/2021 à 11:14, Jeffrey R. Carter a écrit :
> On 8/21/21 6:11 PM, Gareth Baker wrote:
>>
>> I took my versions of the compiler and XNAdaLib back to ones that I
>> had working but got the same behaviour. The only difference being I am
>> now on Big Sur.
>
> It sounds as if the OS version changed something. You might want to
> consider a less OS-dependent GUI library, such as Ada GUI
> (https://github.com/jrcarter/Ada_GUI) or Gnoga
> (https://sourceforge.net/projects/gnoga/).
>
OS dependency is great but what about efficiency ?
WEB technologies are usually resource hungry.

Stéphane Rivière

unread,
Aug 23, 2021, 9:39:43 AM8/23/21
to
> OS dependency is great but what about efficiency ?
> WEB technologies are usually resource hungry.

It's depend of your goal. Reimplent Gimp as a webapp is surely not a
fine idea :) Even there if some mini-gimp implemented today in JS/HTML5.

But for a management software ?

I have big hopes with this special GNAT flavour outputting webassembly.
Coupling Ada_GUI with this compiler could produce amazing results, but
made it for real is far from my skills...

In fact, using GtkAda seems to move the problem of portability to a very
"volatile", not to say unstable, graphic interface.

But there are people here who are better informed and more legitimate
than I am on this subject, especially about GtkAda

Dmitry A. Kazakov

unread,
Aug 23, 2021, 10:24:30 AM8/23/21
to
On 2021-08-23 15:39, Stéphane Rivière wrote:

> I have big hopes with this special GNAT flavour outputting webassembly.
> Coupling Ada_GUI with this compiler could produce amazing results, but
> made it for real is far from my skills...
>
> In fact, using GtkAda seems to move the problem of portability to a very
> "volatile", not to say unstable, graphic interface.

Right, but HTTP interfaces are far more volatile than GTK/GtkAda may
ever dream of...

I think the OP has a very simple problem that a console is created for
the application. Furthermore, it is possible that there are multiple GTK
installations conflicting with each other.

And finally, I understand, there exist posh people, but why anybody
would ever use MacOS!? with a telling nickname surreal or slur... (:-))

Jeffrey R. Carter

unread,
Aug 23, 2021, 10:31:45 AM8/23/21
to
On 8/23/21 3:14 PM, DrPi wrote:
>>
> OS dependency is great but what about efficiency ?
> WEB technologies are usually resource hungry.

S/W engineers only worry about "efficiency" when it becomes an actual issue. GUI
applications usually spend most of their time waiting for user input, so the
"efficiency" of the GUI is not an issue.

--
Jeff Carter
"Strange women lying in ponds distributing swords
is no basis for a system of government."
Monty Python & the Holy Grail
66

Dmitry A. Kazakov

unread,
Aug 23, 2021, 10:35:58 AM8/23/21
to
On 2021-08-23 16:31, Jeffrey R. Carter wrote:
> On 8/23/21 3:14 PM, DrPi wrote:
>>>
>> OS dependency is great but what about efficiency ?
>> WEB technologies are usually resource hungry.
>
> S/W engineers only worry about "efficiency" when it becomes an actual
> issue. GUI applications usually spend most of their time waiting for
> user input, so the "efficiency" of the GUI is not an issue.

True, but when you detect a performance issue in the GUI it is too late
to do anything. GUI libraries force designs when the whole application
is built around the GUI. There is no way back.

DrPi

unread,
Aug 23, 2021, 10:43:13 AM8/23/21
to

Le 23/08/2021 à 16:31, Jeffrey R. Carter a écrit :
> On 8/23/21 3:14 PM, DrPi wrote:
>>>
>> OS dependency is great but what about efficiency ?
>> WEB technologies are usually resource hungry.
>
> S/W engineers only worry about "efficiency" when it becomes an actual
> issue. GUI applications usually spend most of their time waiting for
> user input, so the "efficiency" of the GUI is not an issue.
>
Sure.
I ask because I started to write an application (using GtkAda) where
"efficiency" is of concern.

Simon Wright

unread,
Aug 23, 2021, 12:59:07 PM8/23/21
to
"Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> writes:

> And finally, I understand, there exist posh people, but why anybody
> would ever use MacOS!? with a telling nickname surreal or
> slur... (:-))

Dr Posh here.

I find my Mac extremely comfortable and pleasant to use. I will admit to
it being a little ... different ... in a very few, minor, unimportant
software aspects.

re: which, I thought it might be interesting to try building GTK. Good
grief ...

https://forward-in-code.blogspot.com/2021/08/not-building-gtk-on-big-sur.html

Dmitry A. Kazakov

unread,
Aug 23, 2021, 3:00:29 PM8/23/21
to
On 2021-08-23 18:59, Simon Wright wrote:
> "Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> writes:
>
>> And finally, I understand, there exist posh people, but why anybody
>> would ever use MacOS!? with a telling nickname surreal or
>> slur... (:-))
>
> Dr Posh here.
>
> I find my Mac extremely comfortable and pleasant to use. I will admit to
> it being a little ... different ... in a very few, minor, unimportant
> software aspects.

Well, not so unimportant. It is BSD and that is a really bad omen. I had
immense networking problems with FreeNAS daily crashes, abysmal
performance. FreeNAS is also BSD. Then Ubuntu rolled out ZFS support. I
migrated my NAS to Ubuntu and since then had no problems whatsoever.
Network access is many times faster and the system runs months without
reboot.

> re: which, I thought it might be interesting to try building GTK. Good
> grief ...
>
> https://forward-in-code.blogspot.com/2021/08/not-building-gtk-on-big-sur.html

Last time I looked GTK required bootstrapping. It was a very complicated
process because GTK had recursive dependencies in the packages. I
remember pkg-config was ultimately dependent on itself, or something
like that. Though having there a somehow working installation should
massively ease the process.

Simon Wright

unread,
Aug 23, 2021, 4:34:07 PM8/23/21
to
"Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> writes:

> On 2021-08-23 18:59, Simon Wright wrote:
>> "Dmitry A. Kazakov" <mai...@dmitry-kazakov.de> writes:
>>
>>> And finally, I understand, there exist posh people, but why anybody
>>> would ever use MacOS!? with a telling nickname surreal or
>>> slur... (:-))
>> Dr Posh here.

>> I find my Mac extremely comfortable and pleasant to use. I will admit
>> to it being a little ... different ... in a very few, minor,
>> unimportant software aspects.
>
> Well, not so unimportant. It is BSD and that is a really bad omen. I
> had immense networking problems with FreeNAS daily crashes, abysmal
> performance. FreeNAS is also BSD. Then Ubuntu rolled out ZFS
> support. I migrated my NAS to Ubuntu and since then had no problems
> whatsoever. Network access is many times faster and the system runs
> months without reboot.

I don't suppose one would base a NAS on a macbook pro!

I was actually intending to admit that some aspects of software
development on macOS are less than convenient; largely because of it
being Yet Another Application Interface, rolling up as a less popular
relation of the Unixes, Windows etc of the world and faced with 10
layers deep #ifdefs, autoconf, etc horror. Stick to Ada and the command
line, all much easier!

Dmitry A. Kazakov

unread,
Aug 23, 2021, 4:49:38 PM8/23/21
to
On 2021-08-23 22:34, Simon Wright wrote:

> I don't suppose one would base a NAS on a macbook pro!

Not a bad idea if you have one to spare, lots of memory and cores. You
could connect an external array of HDDs over the thunderbolt. There are
thunderbolt to 10Gbe network adapters. It would be quite expensive
though. My NAS is an old Siemens-Fujitsu i5 desktop.

Chris Townley

unread,
Aug 23, 2021, 4:56:32 PM8/23/21
to
On 23/08/2021 21:49, Dmitry A. Kazakov wrote:
> On 2021-08-23 22:34, Simon Wright wrote:
>
>> I don't suppose one would base a NAS on a macbook pro!
>
> Not a bad idea if you have one to spare, lots of memory and cores. You
> could connect an external array of HDDs over the thunderbolt. There are
> thunderbolt to 10Gbe network adapters. It would be quite expensive
> though. My NAS is an old Siemens-Fujitsu i5 desktop.
>

But isn't Mac OS built on FreeBSD - after all Jordon Hubbord did move
there...

--
Chris

Dmitry A. Kazakov

unread,
Aug 24, 2021, 3:35:41 AM8/24/21
to
I meant only the hardware, of course...

Blady

unread,
Aug 27, 2021, 5:45:13 AM8/27/21
to
Hello Gareth,

Could you give the used GTKAda version and its origin?
Could you share your code or a reproducible test code?

I'll try to reproduce it on macOS Bir Sur.

Pascal.


Gareth Baker

unread,
Aug 27, 2021, 7:16:38 AM8/27/21
to
Pascal,

I used the xnadalib-ce-2021 from source force (2021-big-sur folder); GNAT version from the same source (latest version).

Any GtkAda program I tried has the same issue but the simplest is the terminal hello-world from here:

https://blady.pagesperso-orange.fr/telechargements/gtkada/gtk-ada.pdf

:-)

Thanks for taking the time to reply
Gareth

Blady

unread,
Aug 27, 2021, 11:53:19 AM8/27/21
to
Le 27/08/2021 à 13:16, Gareth Baker a écrit :
> Pascal,
>
> I used the xnadalib-ce-2021 from source force (2021-big-sur folder); GNAT version from the same source (latest version).
>
> Any GtkAda program I tried has the same issue but the simplest is the terminal hello-world from here:
>
> https://blady.pagesperso-orange.fr/telechargements/gtkada/gtk-ada.pdf

Thanks Gareth for reading despite the tutorial is in French language.

I'm confused because the screen captures were actually done with GTKAda
CE 2021 on macOS 11.
The console icon of the Hello program should appear in the Mac Dock,
click on the icon to put the window in front.

Is GTKAda installed in /usr/local, see
https://sourceforge.net/projects/gnuada/files/GNAT_GPL%20Mac%20OS%20X/2021-big-sur/
?

To test it, as shown in tutorial section 1, could you run the GTKAda
test program?
$ xnadalib=/usr/local/xnadalib-ce-2021
$ cd $xnadalib/share/examples/gtkada/testgtk
$ export XDG_DATA_DIRS=$xnadalib/share
$ ./testgtk

If not good, could you run the GTK test program?
% export XDG_DATA_DIRS=/usr/local/xnadalib-ce-2021/share
% cd /usr/local/xnadalib-ce-2021/bin
% ./gtk3-demo

HTH, Pascal.


Gareth Baker

unread,
Aug 27, 2021, 12:13:43 PM8/27/21
to
Pascal,

Okay - thanks for replying.

The testgtk program does the same thing, a window opens up with the program shrunk to 1/4 size against a black background.

The gtk3-demo is slightly different in that it opens up on its own but I think again it is 1/4 of the size it should be and the mouse clicks do not work where they should.

I’m on macOS 15.5.2.

Other programs run from the terminal (python with qt GUI) work okay.

Thanks
Gareth

Simon Wright

unread,
Aug 27, 2021, 1:12:31 PM8/27/21
to
Gareth Baker <gareth...@gmail.com> writes:

> Pascal,
>
> Okay - thanks for replying.
>
> The testgtk program does the same thing, a window opens up with the
> program shrunk to 1/4 size against a black background.
>
> The gtk3-demo is slightly different in that it opens up on its own but
> I think again it is 1/4 of the size it should be and the mouse clicks
> do not work where they should.

Same here.

> I’m on macOS 15.5.2.

11.5.2 I think!

I had to run "sudo xattr -d com.apple.quarantine" on bin/*, lib/*.dylib,
lib/*.so, and the testgtk program.

Also, on page 2 of
https://blady.pagesperso-orange.fr/telechargements/gtkada/gtk-ada.pdf,
it should say
$ PATH=/opt/gnat-ce-2021/bin:$PATH
not
$ PATH=/opt/gnat-ce-2021:$PATH

Gareth Baker

unread,
Aug 27, 2021, 2:58:08 PM8/27/21
to
Humm - not sure why but removing the security attribute does not work for me.

Gareth
On Friday, 27 August 2021 at 18:12:31 UTC+1, Simon Wright wrote:

Simon Wright

unread,
Aug 27, 2021, 3:48:43 PM8/27/21
to
Gareth Baker <gareth...@gmail.com> writes:

> Humm - not sure why but removing the security attribute does not work
> for me.

Without removing it the programs won't run at all, unless you've turned
off system integrity protection (bad idea).

And having removed it, as I said, I see the same unexpected behaviour
you do.

Pascal, I'm on a MacBook Pro (Retina, 13-inch, Early 2015)

Gareth Baker

unread,
Aug 27, 2021, 4:05:12 PM8/27/21
to
Simon,

Ahh - okay I did not read your reply correctly.

Perhaps I should turn gatekeeper back on :-) I've had it turned off for a while to, as you point out, get ada programmes running at all.

Gareth

Blady

unread,
Aug 28, 2021, 9:42:55 AM8/28/21
to
Le 27/08/2021 à 19:12, Simon Wright a écrit :
> Gareth Baker <gareth...@gmail.com> writes:
>
>> Pascal,
>>
>> Okay - thanks for replying.
>>
>> The testgtk program does the same thing, a window opens up with the
>> program shrunk to 1/4 size against a black background.
>>
>> The gtk3-demo is slightly different in that it opens up on its own but
>> I think again it is 1/4 of the size it should be and the mouse clicks
>> do not work where they should.
>
> Same here.
>
>> I’m on macOS 15.5.2.
>
> 11.5.2 I think!

macOS 11.5.2 too.

> I had to run "sudo xattr -d com.apple.quarantine" on bin/*, lib/*.dylib,
> lib/*.so, and the testgtk program.

I forgot to mention that in Readme, I'll change it on SF.
I should package the whole as you do for GNAT.

> Also, on page 2 of
> https://blady.pagesperso-orange.fr/telechargements/gtkada/gtk-ada.pdf,
> it should say
> $ PATH=/opt/gnat-ce-2021/bin:$PATH
> not
> $ PATH=/opt/gnat-ce-2021:$PATH

Thanks for the typo, fixed in source text.

The reported behavior by Gareth and you is quite puzzling.
Maybe one configuration difference could be Xcode.
I installed only Xcode (no CL tools):
% xcodebuild -version
Xcode 12.5.1
Build version 12E507
% pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
% xcode-select -p
/Applications/Xcode.app/Contents/Developer

I guess nothing relevant was printed in the Terminal.
However, could you check the dylib loading with DYLD_PRINT_LIBRARIES?
For instance:
% DYLD_PRINT_LIBRARIES=1 ./gtk3-demo

Other ideas are welcome :-)

Pascal.
0 new messages