comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: GtkAda callback and event
Date: Thu, 9 Sep 2021 11:41:50 -0700 (PDT)	[thread overview]
Message-ID: <757da468-7b58-43c2-95e6-917b3212f7b2n@googlegroups.com> (raw)
In-Reply-To: <6139be6f$0$12704$426a74cc@news.free.fr>

On Thursday, September 9, 2021 at 3:57:37 AM UTC-4, DrPi wrote:
> Le 09/09/2021 à 08:56, Emmanuel Briot a écrit : 
> > You could perhaps consider using some of the higher-level event handling functions that 
> > are generated as part of the binding. For instance, `gtk-widget.ads` has: 
> > 
> > ``` 
> > <SNIPPED>
> > ``` 
> > 
> > This ensures the proper list of parameters for the callback, and automatically gets you 
> > the Event, for instance. 
> >
> The problem with these functions is that you can't pass a user record to 
> the callback.

I'm not as versed in GtkAda, but it looks like those have 'Class types so if
it is like most of the other GUI frameworks out there, you typically would
extend the type that you are doing the handler for and your user data would
be fields of the new record type.  Since the handler uses 'Class you could just 
cast the parameter to your new type and have access to the user data.

Otherwise I'm not sure what you mean.  The GUI work loop doesn't generally 
pass user data to a callback, just the event and the listener to the event.  All
user data in most GUI frameworks is handled on the listener side, which is
why a lot of them rely on type extension of the listener type.

  reply	other threads:[~2021-09-09 18:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 21:39 GtkAda callback and event DrPi
2021-09-04 22:29 ` Dmitry A. Kazakov
2021-09-05 13:50   ` DrPi
2021-09-05 14:48     ` Dmitry A. Kazakov
2021-09-05 14:58       ` DrPi
2021-09-05 15:04         ` DrPi
2021-09-05 15:12           ` Dmitry A. Kazakov
2021-09-05 15:20             ` DrPi
2021-09-05 15:53               ` Dmitry A. Kazakov
2021-09-05 20:49                 ` DrPi
2021-09-09  6:56                   ` Emmanuel Briot
2021-09-09  7:57                     ` DrPi
2021-09-09 18:41                       ` Jere [this message]
2021-09-09 19:58                         ` Dmitry A. Kazakov
2021-09-09 21:01                           ` Jere
2021-09-10  6:38                             ` Dmitry A. Kazakov
2021-09-10  6:56                               ` Emmanuel Briot
2021-09-10 20:42                                 ` DrPi
2021-09-10 20:58                                   ` Dmitry A. Kazakov
2021-09-11  7:38                                     ` Emmanuel Briot
2021-09-11 15:24                                     ` DrPi
2021-09-11 15:56                                       ` Dmitry A. Kazakov
2021-09-12  7:08                                       ` AdaMagica
2021-09-12  8:52                                         ` Dmitry A. Kazakov
2021-09-12 13:00                                           ` DrPi
2021-09-12 13:57                                             ` Dmitry A. Kazakov
2021-09-10 20:46                                 ` Dmitry A. Kazakov
2021-09-11  7:36                                   ` Emmanuel Briot
replies disabled

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