From: "Luke A. Guest" <laguest@archeia.com>
Subject: Re: What does this error mean and how do I correct this?
Date: Fri, 1 Sep 2023 22:41:54 +0100 [thread overview]
Message-ID: <uctlr2$17md$1@dont-email.me> (raw)
In-Reply-To: <uctjkg$q7d$1@dont-email.me>
Handler needs to be in a package you with.
On 01/09/2023 22:04, richardthiebaud wrote:
> in the following program:
>
> with Gtk.Enums; use Gtk.Enums;
> with Gtk.Main;
> with Gtk.Window;
> with Gdk;
> with Gdk.Event;
> with Glib;
> with Glib.Object;
>
> procedure test1 is
> Win : Gtk.Window.Gtk_Window;
> function Handler
> (Self : access Glib.Object.GObject_Record'Class;
> Event : Gdk.Event.Gdk_Event_Button) return Boolean is
> begin
> Gtk.Main.Main_Quit;
> return True;
> end Handler;
> --
> -- defined in gtk-widget.ads
> --
> -- type Cb_GObject_Gdk_Event_Button_Boolean is not null access
> function
> -- (Self : access Glib.Object.GObject_Record'Class;
> -- Event : Gdk.Event.Gdk_Event_Button) return Boolean;
>
> begin -- Gtk.Init;
> Gtk.Main.Init;
> Gtk.Window.Gtk_New (Window => Win, The_Type =>
> Gtk.Enums.Window_Toplevel);
> Win.Set_Position (Win_Pos_Center);
> Gtk.Window.Set_Title (Window => Win, Title => "Editor");
> Gtk.Window.Show_All (Win);
> Win.On_Button_Press_Event <------------ line that gets the error
> (Call => Handler'Access,
> After => False,
> Slot => Win);
> Gtk.Main.Main;
> end test1;
>
> I get the compiler error message:
>
> test1.adb:32:17: subprogram must not be deeper than access type
>
> What does this mean and how can I correct it?
next prev parent reply other threads:[~2023-09-01 21:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 21:04 What does this error mean and how do I correct this? richardthiebaud
2023-09-01 21:41 ` Luke A. Guest [this message]
2023-09-01 21:44 ` Luke A. Guest
2023-09-01 22:51 ` richardthiebaud
2023-09-03 14:06 ` Simon Wright
2023-09-03 15:22 ` Luke A. Guest
2023-09-03 18:44 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox