From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_20,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:5290:: with SMTP id s16mr1395964qtn.412.1631170618683; Wed, 08 Sep 2021 23:56:58 -0700 (PDT) X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr1873668ybu.91.1631170618301; Wed, 08 Sep 2021 23:56:58 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 8 Sep 2021 23:56:58 -0700 (PDT) In-Reply-To: <61352d42$0$3749$426a74cc@news.free.fr> Injection-Info: google-groups.googlegroups.com; posting-host=87.88.29.208; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH NNTP-Posting-Host: 87.88.29.208 References: <6133e791$0$6461$426a74cc@news.free.fr> <6134cb26$0$3697$426a74cc@news.free.fr> <6134db32$0$6461$426a74cc@news.free.fr> <6134dc71$0$3693$426a74cc@news.free.fr> <6134e03d$0$3372$426a74cc@news.free.fr> <61352d42$0$3749$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <944e2cf6-2e24-480e-b7f7-0e0e0f5082e7n@googlegroups.com> Subject: Re: GtkAda callback and event From: Emmanuel Briot Injection-Date: Thu, 09 Sep 2021 06:56:58 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:62678 List-Id: 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.