comp.lang.ada
 help / color / mirror / Atom feed
From: slos <new.stephane.los@gmail.com>
Subject: Re: Gnoga Callback Handlers with user data
Date: Sun, 22 Nov 2015 13:44:21 -0800 (PST)
Date: 2015-11-22T13:44:21-08:00	[thread overview]
Message-ID: <33bdc708-11fa-4091-8569-9436397e1695@googlegroups.com> (raw)
In-Reply-To: <5f76d6a8-f733-4f36-89df-56eefcd795f8@googlegroups.com>

Dear Mister Botton,

Thanks for your answer.

Le dimanche 22 novembre 2015 16:42:25 UTC+1, David Botton a écrit :
> The handler will be receiving Object a class-wide object as its parameter which contains the actual Ada Object (in this case the My_Button instance) bound to the button. So you can just check to see if Object is My_Button or any other button using Ada or you can compare Unique_IDs (if My_Button.Unique_ID = Object.Unique_ID).
> 
In your tutorial tutorial_04.adb we have :
   procedure On_Click (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
      App : App_Access := App_Access (Object.Connection_Data);
   begin
      App.My_View.Put ("I've been clicked! ");

where :
   type App_Data is new Gnoga.Types.Connection_Data_Type with
      record
         My_View   : Gnoga.Gui.View.View_Type;
         My_Button : Gnoga.Gui.Element.Common.Button_Type;
         My_Exit   : Gnoga.Gui.Element.Common.Button_Type;
         Flasher   : aliased Gnoga.Gui.Element.Common.DIV_Type;

is associated with :
      Main_Window.Connection_Data (App);

So actually, the On_Click handler gets all the App stuff without other indication.

> You should join the Gnoga list https://lists.sourceforge.net/lists/listinfo/gnoga-list

Yes I should but by writting here I wanted to show my interest for your project to others.
Does it hurt ?

Best Regards,
Stéphane
"Ada for Automation"
http://slo-ist.fr/ada4autom


  reply	other threads:[~2015-11-22 21:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-22 11:53 Gnoga Callback Handlers with user data slos
2015-11-22 15:42 ` David Botton
2015-11-22 21:44   ` slos [this message]
2015-11-23  0:50     ` David Botton
2015-11-23 10:44       ` slos
2015-11-23 17:24         ` David Botton
2015-11-23 22:12           ` slos
2015-11-23 23:34             ` David Botton
2015-11-25  8:00               ` slos
2015-11-23 17:41         ` Jeffrey R. Carter
2015-11-23 22:19           ` slos
replies disabled

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