comp.lang.ada
 help / color / mirror / Atom feed
* Gtkada on Mac using Quartz
@ 2015-08-22  8:30 ahlan
  2015-08-22  8:46 ` Dmitry A. Kazakov
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: ahlan @ 2015-08-22  8:30 UTC (permalink / raw)


Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.

Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.

So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
This seemed to work. :-)
Apparently I now have Gtk 3.16.0 installed on my Mac.

On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar

After decompressing these sources I ran
CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents

This did lots of checking, liked what it found and created various makefiles and .gpr files.
So far so good ;-)
 
I then started the build by issuing the command Make
This started - but quickly failed ;-(

gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
/Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
      'gdk/gdkquartz.h' file not found
#include <gdk/gdkquartz.h>
         ^
gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
1 error generated.

   compilation of misc_osx.m failed

gprbuild: *** compilation phase failed

Has anyone any idea why the file gdkquartz.h is missing?
Do I have to do something in addition to get the files for gdk Quartz?
Should I get this file and then see what happens next?
Or am I wasting my time?

Has anyone ventured down this path - perhaps even getting GtkAda to work?

Best wishes,
Ahlan


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
@ 2015-08-22  8:46 ` Dmitry A. Kazakov
  2015-08-22 12:44   ` ahlan
  2015-08-22 15:46 ` ahlan
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Dmitry A. Kazakov @ 2015-08-22  8:46 UTC (permalink / raw)


On Sat, 22 Aug 2015 01:30:22 -0700 (PDT), ahlan@marriott.org wrote:

> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?

Because you didn't install it? I don't know Mac OS, I suppose gdkquartz.h
is a part of a gtk-quartz developing package you should have installed.

BTW, gtkada-dialogs might not work under GTK 3.16. Guys are busy loading
GTK with new incompatibilities... I am going to publish GtkAda
contributions with replacements for deprecated dialog functions tomorrow.

> Has anyone ventured down this path - perhaps even getting GtkAda to work?

I compiled GtkAda for Fedora and Debian. (ARM targets need some work
because they have gprbuild broken)

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:46 ` Dmitry A. Kazakov
@ 2015-08-22 12:44   ` ahlan
  0 siblings, 0 replies; 13+ messages in thread
From: ahlan @ 2015-08-22 12:44 UTC (permalink / raw)


Problem solved.
It appears that i can't type.
I used macport to install Gtk and typed +quatz instead of +quartz and so it installed the X11 version instead of Quartz. :-(

After I reinstalled it for +quartz I was able to use the installation of GtkAda to build the bindings.
I was also able to build testgtk and my test program.

Although both of these work under Ubuntu and windows, neither work under Yosemite.

Perhaps the problem lies by my using a newer version of Gtk?
Has anyone any experience with Gtk on Mac?
Should I use an older version?
If so which - 3.8.4 perhaps?


On Saturday, August 22, 2015 at 10:47:21 AM UTC+2, Dmitry A. Kazakov wrote:
> On Sat, 22 Aug 2015 01:30:22 -0700 (PDT), ahlan@marriott.org wrote:
> 
> > I then started the build by issuing the command Make
> > This started - but quickly failed ;-(
> > 
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> > /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
> >       'gdk/gdkquartz.h' file not found
> > #include <gdk/gdkquartz.h>
> >          ^
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> > 1 error generated.
> > 
> >    compilation of misc_osx.m failed
> > 
> > gprbuild: *** compilation phase failed
> > 
> > Has anyone any idea why the file gdkquartz.h is missing?
> 
> Because you didn't install it? I don't know Mac OS, I suppose gdkquartz.h
> is a part of a gtk-quartz developing package you should have installed.
> 
> BTW, gtkada-dialogs might not work under GTK 3.16. Guys are busy loading
> GTK with new incompatibilities... I am going to publish GtkAda
> contributions with replacements for deprecated dialog functions tomorrow.
> 
> > Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> I compiled GtkAda for Fedora and Debian. (ARM targets need some work
> because they have gprbuild broken)
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de



On Saturday, August 22, 2015 at 10:47:21 AM UTC+2, Dmitry A. Kazakov wrote:
> On Sat, 22 Aug 2015 01:30:22 -0700 (PDT), ahlan@marriott.org wrote:
> 
> > I then started the build by issuing the command Make
> > This started - but quickly failed ;-(
> > 
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> > /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
> >       'gdk/gdkquartz.h' file not found
> > #include <gdk/gdkquartz.h>
> >          ^
> > gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> > 1 error generated.
> > 
> >    compilation of misc_osx.m failed
> > 
> > gprbuild: *** compilation phase failed
> > 
> > Has anyone any idea why the file gdkquartz.h is missing?
> 
> Because you didn't install it? I don't know Mac OS, I suppose gdkquartz.h
> is a part of a gtk-quartz developing package you should have installed.
> 
> BTW, gtkada-dialogs might not work under GTK 3.16. Guys are busy loading
> GTK with new incompatibilities... I am going to publish GtkAda
> contributions with replacements for deprecated dialog functions tomorrow.
> 
> > Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> I compiled GtkAda for Fedora and Debian. (ARM targets need some work
> because they have gprbuild broken)
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
  2015-08-22  8:46 ` Dmitry A. Kazakov
@ 2015-08-22 15:46 ` ahlan
  2015-08-23  8:50 ` ahlan
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: ahlan @ 2015-08-22 15:46 UTC (permalink / raw)


GtkAda on Mac doesn't work using the latest gtk for Quartz 3.16.6.
However if I use 3.8.4 then testgtk seems to work.
Unfortunately not my test program :-(
My test program doesn't even show the main window!

However if the demo program testgtk works then at least there is the possibility of my getting my program to work. ;-)

Ahlan

On Saturday, August 22, 2015 at 10:30:26 AM UTC+2, ah...@marriott.org wrote:
> Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.
> 
> Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.
> 
> So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
> This seemed to work. :-)
> Apparently I now have Gtk 3.16.0 installed on my Mac.
> 
> On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar
> 
> After decompressing these sources I ran
> CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents
> 
> This did lots of checking, liked what it found and created various makefiles and .gpr files.
> So far so good ;-)
>  
> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?
> Do I have to do something in addition to get the files for gdk Quartz?
> Should I get this file and then see what happens next?
> Or am I wasting my time?
> 
> Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> Best wishes,
> Ahlan


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
  2015-08-22  8:46 ` Dmitry A. Kazakov
  2015-08-22 15:46 ` ahlan
@ 2015-08-23  8:50 ` ahlan
  2015-08-23 13:05 ` ahlan
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: ahlan @ 2015-08-23  8:50 UTC (permalink / raw)


My test program fails with a constraint error with the message "Erroneous memory access" as soon as I call gtk.main.events_pending

As this is only a wrapper around gtk_events_pending I guess that's game over for me. :-(

Sad really, because I almost had my first Ada program with a Gui working on a Mac.

Unless anyone has any idea why gtk_events_pending might fail?

Ahlan
On Saturday, August 22, 2015 at 10:30:26 AM UTC+2, ah...@marriott.org wrote:
> Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.
> 
> Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.
> 
> So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
> This seemed to work. :-)
> Apparently I now have Gtk 3.16.0 installed on my Mac.
> 
> On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar
> 
> After decompressing these sources I ran
> CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents
> 
> This did lots of checking, liked what it found and created various makefiles and .gpr files.
> So far so good ;-)
>  
> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?
> Do I have to do something in addition to get the files for gdk Quartz?
> Should I get this file and then see what happens next?
> Or am I wasting my time?
> 
> Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> Best wishes,
> Ahlan


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
                   ` (2 preceding siblings ...)
  2015-08-23  8:50 ` ahlan
@ 2015-08-23 13:05 ` ahlan
  2015-08-23 13:32   ` Dmitry A. Kazakov
  2015-08-23 14:39 ` ahlan
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: ahlan @ 2015-08-23 13:05 UTC (permalink / raw)


After a bit more investigation it turns out that it is not gtk_event_pending that is at fault - the same thing happens with Gtk.Main.main.

The problem seems to be that I execute all my Gtk calls in a task rather than in the main program.
If I call Gtk.Main.init then create and show a Gtk.window followed by Gtk.Main.Main in the body of the main program then this works.
If I do the same thing in a task then it fails and returns a constraint error - erroneous memory access.
Setting the storage size of the task doesn't seem to help.
Is there anything special about Ada tasks on a mac that might prevent Gtk from working?

Has anyone been able to use Gtk from a task rather than from the program body?

MfG
Ahlan

On Saturday, August 22, 2015 at 10:30:26 AM UTC+2, ah...@marriott.org wrote:
> Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.
> 
> Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.
> 
> So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
> This seemed to work. :-)
> Apparently I now have Gtk 3.16.0 installed on my Mac.
> 
> On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar
> 
> After decompressing these sources I ran
> CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents
> 
> This did lots of checking, liked what it found and created various makefiles and .gpr files.
> So far so good ;-)
>  
> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?
> Do I have to do something in addition to get the files for gdk Quartz?
> Should I get this file and then see what happens next?
> Or am I wasting my time?
> 
> Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> Best wishes,
> Ahlan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-23 13:05 ` ahlan
@ 2015-08-23 13:32   ` Dmitry A. Kazakov
  0 siblings, 0 replies; 13+ messages in thread
From: Dmitry A. Kazakov @ 2015-08-23 13:32 UTC (permalink / raw)


On Sun, 23 Aug 2015 06:05:55 -0700 (PDT), ahlan@marriott.org wrote:

> The problem seems to be that I execute all my Gtk calls in a task rather
> than in the main program. If I call Gtk.Main.init then create and show a
> Gtk.window followed by Gtk.Main.Main in the body of the main program then
> this works.

GTK calls must be done on the context of the same task/thread running the
messages loop.

> Is there anything special about Ada tasks on a mac that might prevent Gtk
> from working?

Special is GTK, GDK, Gobject, GIO and the rest, which are not
multi-threaded. 

I don't think it must be the main task of the process, it could be any
task, but just one task.

I didn't try GTK running on a non-main task, because it would not make much
sense anyway. It is possible that Mac OS could have some limitations on
this, that depends on the Mac OS GDK backend. I doubt it is the case,
though.

> Has anyone been able to use Gtk from a task rather than from the program body?

See:

http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#1

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
                   ` (3 preceding siblings ...)
  2015-08-23 13:05 ` ahlan
@ 2015-08-23 14:39 ` ahlan
  2015-08-23 15:05   ` Dmitry A. Kazakov
  2015-08-24  9:43   ` Stephen Leake
  2015-08-24 12:53 ` ahlan
  2015-09-05 19:50 ` ahlan
  6 siblings, 2 replies; 13+ messages in thread
From: ahlan @ 2015-08-23 14:39 UTC (permalink / raw)


Dear Dmitry,

I am aware that all Gtk calls must be issued from the same task/thread that runs the message loop.
In fact I use a similar method to the one you implemented in the GtkAda contributions.

However in my tiny test I only issued init, create, show and main, nothing else and all from the same thread.
If issued from the main program it works, if issued from a task is doesn't.

In both cases all Gtk calls are made from the same thread so my understanding is that this should work.
As a matter of style I don't like using the main thread to run the Gui main loop - I suppose I could modify all my programs - but i'd rather not. ;-)

My guess is that the problem is something OS X specific - I thought of stack size but that doesn't appear to be the problem. Perhaps it has something to do with 32/64 bit addresses - although I had no problems with 64 bit Ubuntu.

Has anyone has tried running Gtk in a task on OS X and got it work?
Anyone?
AdaCore - GPS?

Best wishes,
Ahlan

On Saturday, August 22, 2015 at 10:30:26 AM UTC+2, ah...@marriott.org wrote:
> Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.
> 
> Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.
> 
> So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
> This seemed to work. :-)
> Apparently I now have Gtk 3.16.0 installed on my Mac.
> 
> On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar
> 
> After decompressing these sources I ran
> CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents
> 
> This did lots of checking, liked what it found and created various makefiles and .gpr files.
> So far so good ;-)
>  
> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?
> Do I have to do something in addition to get the files for gdk Quartz?
> Should I get this file and then see what happens next?
> Or am I wasting my time?
> 
> Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> Best wishes,
> Ahlan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-23 14:39 ` ahlan
@ 2015-08-23 15:05   ` Dmitry A. Kazakov
  2015-08-23 16:06     ` Simon Wright
  2015-08-24  9:43   ` Stephen Leake
  1 sibling, 1 reply; 13+ messages in thread
From: Dmitry A. Kazakov @ 2015-08-23 15:05 UTC (permalink / raw)


On Sun, 23 Aug 2015 07:39:09 -0700 (PDT), ahlan@marriott.org wrote:

> My guess is that the problem is something OS X specific - I thought of
> stack size but that doesn't appear to be the problem. Perhaps it has
> something to do with 32/64 bit addresses - although I had no problems with
> 64 bit Ubuntu.

If it is the GDI, then Gtk.Main.Init + Gtk.Main.Main would not crash.
Possibly not even if the window is created but never shown.

I think you should take a look how Mac OS specific stuff is implemented and
investigate the OS API it uses.

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-23 15:05   ` Dmitry A. Kazakov
@ 2015-08-23 16:06     ` Simon Wright
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Wright @ 2015-08-23 16:06 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> I think you should take a look how Mac OS specific stuff is
> implemented and investigate the OS API it uses.

pthreads; of course, may have Darwin-specific weirdnesses.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-23 14:39 ` ahlan
  2015-08-23 15:05   ` Dmitry A. Kazakov
@ 2015-08-24  9:43   ` Stephen Leake
  1 sibling, 0 replies; 13+ messages in thread
From: Stephen Leake @ 2015-08-24  9:43 UTC (permalink / raw)


ahlan@marriott.org writes:

> Dear Dmitry,
>
> I am aware that all Gtk calls must be issued from the same task/thread
> that runs the message loop.
> In fact I use a similar method to the one you implemented in the GtkAda contributions.
>
> However in my tiny test I only issued init, create, show and main,
> nothing else and all from the same thread.
> If issued from the main program it works, if issued from a task is
> doesn't.

This suggests there is some elaboration code in the GtkAda package
that is run on the main thread.

-- 
-- Stephe


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
                   ` (4 preceding siblings ...)
  2015-08-23 14:39 ` ahlan
@ 2015-08-24 12:53 ` ahlan
  2015-09-05 19:50 ` ahlan
  6 siblings, 0 replies; 13+ messages in thread
From: ahlan @ 2015-08-24 12:53 UTC (permalink / raw)


Dear Stephe,

These applications all work on both Windows and Ubuntu.
If there was was Gtk usage problem, such as code being elaborated in the main program then I would have expected the code to fail on the other platforms.

I wonder if there isn't some pragma or something I need in order to tell OSX that the task is whatever Gtk needs it to be.

For example stack size - but perhaps there are other pragmas that do task oriented stuff that OSX needs?

Ahlan

On Saturday, August 22, 2015 at 10:30:26 AM UTC+2, ah...@marriott.org wrote:
> Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.
> 
> Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.
> 
> So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
> This seemed to work. :-)
> Apparently I now have Gtk 3.16.0 installed on my Mac.
> 
> On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar
> 
> After decompressing these sources I ran
> CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents
> 
> This did lots of checking, liked what it found and created various makefiles and .gpr files.
> So far so good ;-)
>  
> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?
> Do I have to do something in addition to get the files for gdk Quartz?
> Should I get this file and then see what happens next?
> Or am I wasting my time?
> 
> Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> Best wishes,
> Ahlan


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gtkada on Mac using Quartz
  2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
                   ` (5 preceding siblings ...)
  2015-08-24 12:53 ` ahlan
@ 2015-09-05 19:50 ` ahlan
  6 siblings, 0 replies; 13+ messages in thread
From: ahlan @ 2015-09-05 19:50 UTC (permalink / raw)


In case anyone is interested, I managed to get my non-trivial GUI test program, written using GPL-2015 Gnat Ada and GPL-2015 GtkAda to work without any source changes on all three of my selected targets, namely Windows (XP), Linux (Ubuntu) and OS X (Yosemite).
Yosemite was the biggest challenge because AdaCore for some reason didn't provide a GtkAda installation as they did for Windows and Linux.
Which meant that i had to get and compile Gtk myself.
Fortunately the linux installation worked Ok on OS X.
The other problem is that on Yosemite the Gtk thread has to be the main thread.
This restriction does not apply for Windows and Ubuntu.
However after rewriting my Gui package to use the main thread, the program ran on all platforms.
Which, I think, is rather cool! :-)


On Saturday, August 22, 2015 at 10:30:26 AM UTC+2, ah...@marriott.org wrote:
> Has anyone managed to install GtkAda on a Mac, preferably GPL 2015.
> 
> Unfortunately AdaCore doesn't provide a GtkAda installation for MacOs as part of its GPL offering however as there is a MacPort of Gtk I rather hoped that all I had to do was compile the GtkAda bindings to Gtk.
> 
> So I installed MacPorts and Xcode and then did the port install of gtk3 +quartz.
> This seemed to work. :-)
> Apparently I now have Gtk 3.16.0 installed on my Mac.
> 
> On the perhaps faulty and naive assumption that compiling the GtkAda bindings would be the same as for linux I tried to use gtkada-gpl-2015-src.tar
> 
> After decompressing these sources I ran
> CC=/usr/bin/gcc ./configure --prefix=/Users/Ahlan/Documents
> 
> This did lots of checking, liked what it found and created various makefiles and .gpr files.
> So far so good ;-)
>  
> I then started the build by issuing the command Make
> This started - but quickly failed ;-(
> 
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-mdi.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-intl.adb
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-handlers.ads
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-file_selection.adb
> /Users/Ahlan/Documents/gtkada-gpl-2015-src/src/misc_osx.m:37:10: fatal error: 
>       'gdk/gdkquartz.h' file not found
> #include <gdk/gdkquartz.h>
>          ^
> gcc -c -gnat05 -gnatQ -O2 -gnatn -gnatws gtkada-dialogs.adb
> 1 error generated.
> 
>    compilation of misc_osx.m failed
> 
> gprbuild: *** compilation phase failed
> 
> Has anyone any idea why the file gdkquartz.h is missing?
> Do I have to do something in addition to get the files for gdk Quartz?
> Should I get this file and then see what happens next?
> Or am I wasting my time?
> 
> Has anyone ventured down this path - perhaps even getting GtkAda to work?
> 
> Best wishes,
> Ahlan


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-09-05 19:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-22  8:30 Gtkada on Mac using Quartz ahlan
2015-08-22  8:46 ` Dmitry A. Kazakov
2015-08-22 12:44   ` ahlan
2015-08-22 15:46 ` ahlan
2015-08-23  8:50 ` ahlan
2015-08-23 13:05 ` ahlan
2015-08-23 13:32   ` Dmitry A. Kazakov
2015-08-23 14:39 ` ahlan
2015-08-23 15:05   ` Dmitry A. Kazakov
2015-08-23 16:06     ` Simon Wright
2015-08-24  9:43   ` Stephen Leake
2015-08-24 12:53 ` ahlan
2015-09-05 19:50 ` ahlan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox