comp.lang.ada
 help / color / mirror / Atom feed
From: DrPi <314@drpi.fr>
Subject: Re: GtkAda callback and event
Date: Thu, 9 Sep 2021 09:57:29 +0200	[thread overview]
Message-ID: <6139be6f$0$12704$426a74cc@news.free.fr> (raw)
In-Reply-To: <944e2cf6-2e24-480e-b7f7-0e0e0f5082e7n@googlegroups.com>

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:
> 
> ```
> type Cb_Gtk_Widget_Gdk_Event_Motion_Boolean is not null access function
>       (Self  : access Gtk_Widget_Record'Class;
>        Event : Gdk.Event.Gdk_Event_Motion) return Boolean;
> 
>     type Cb_GObject_Gdk_Event_Motion_Boolean is not null access function
>       (Self  : access Glib.Object.GObject_Record'Class;
>        Event : Gdk.Event.Gdk_Event_Motion) return Boolean;
> 
>     Signal_Motion_Notify_Event : constant Glib.Signal_Name := "motion-notify-event";
>     procedure On_Motion_Notify_Event
>        (Self  : not null access Gtk_Widget_Record;
>         Call  : Cb_Gtk_Widget_Gdk_Event_Motion_Boolean;
>         After : Boolean := False);
>     procedure On_Motion_Notify_Event
>        (Self  : not null access Gtk_Widget_Record;
>         Call  : Cb_GObject_Gdk_Event_Motion_Boolean;
>         Slot  : not null access Glib.Object.GObject_Record'Class;
>         After : Boolean := False);
>   ```
> 
> 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.

  reply	other threads:[~2021-09-09  7:57 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 [this message]
2021-09-09 18:41                       ` Jere
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