Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

'Course, I haven't weighed in yet. :-) -- Larry Wall in <199710281816.KAA29614@wall.org>


devel / comp.lang.ada / Re: What does this error mean and how do I correct this?

SubjectAuthor
* What does this error mean and how do I correct this?richardthiebaud
`* Re: What does this error mean and how do I correct this?Luke A. Guest
 `* Re: What does this error mean and how do I correct this?Luke A. Guest
  `* Re: What does this error mean and how do I correct this?richardthiebaud
   `* Re: What does this error mean and how do I correct this?Simon Wright
    +- Re: What does this error mean and how do I correct this?Luke A. Guest
    `- Re: What does this error mean and how do I correct this?Simon Wright

1
What does this error mean and how do I correct this?

<uctjkg$q7d$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9980&group=comp.lang.ada#9980

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: thiebauddick2@aol.com (richardthiebaud)
Newsgroups: comp.lang.ada
Subject: What does this error mean and how do I correct this?
Date: Fri, 1 Sep 2023 17:04:16 -0400
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <uctjkg$q7d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 1 Sep 2023 21:04:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3b6b747f69f64fd10b8d64112b94ba09";
logging-data="26861"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EOyYoJDoNmUERtpEQLsFeO/Q108Pxh/k="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:xAB0xCgb0IDWrrv9UzHyi5eIUD4=
Content-Language: en-US
 by: richardthiebaud - Fri, 1 Sep 2023 21:04 UTC

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?

Re: What does this error mean and how do I correct this?

<uctlr2$17md$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9981&group=comp.lang.ada#9981

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: laguest@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: What does this error mean and how do I correct this?
Date: Fri, 1 Sep 2023 22:41:54 +0100
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <uctlr2$17md$1@dont-email.me>
References: <uctjkg$q7d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 1 Sep 2023 21:41:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="071b60dbcff7ef73c47f3433fa26b33f";
logging-data="40653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QOTTCFlhy+s4Tz8hpLgK+qPjXMkB9Was="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:S0LfW0CrNEXI3wl1BFRVx00PG/o=
In-Reply-To: <uctjkg$q7d$1@dont-email.me>
Content-Language: en-GB
 by: Luke A. Guest - Fri, 1 Sep 2023 21:41 UTC

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?

Re: What does this error mean and how do I correct this?

<uctlvd$17md$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9982&group=comp.lang.ada#9982

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: laguest@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: What does this error mean and how do I correct this?
Date: Fri, 1 Sep 2023 22:44:13 +0100
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uctlvd$17md$2@dont-email.me>
References: <uctjkg$q7d$1@dont-email.me> <uctlr2$17md$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 1 Sep 2023 21:44:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="071b60dbcff7ef73c47f3433fa26b33f";
logging-data="40653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ddd133rHo2VTyljlYDlYsOj2efy0lv7A="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:KJH3dXOtQ8qXa3yVERP7FPoS79k=
In-Reply-To: <uctlr2$17md$1@dont-email.me>
Content-Language: en-GB
 by: Luke A. Guest - Fri, 1 Sep 2023 21:44 UTC

On 01/09/2023 22:41, Luke A. Guest wrote:
> Handler needs to be in a package you with.
>

>> 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

Ada doesn't like 'access types to be in an area that can go out of scope
iirc. You can get around it with unchecked_access, but if you put
handler into a package of it's own, it's at library level and is
available to grab the access of.

Re: What does this error mean and how do I correct this?

<uctpts$1p5s$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9983&group=comp.lang.ada#9983

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: thiebauddick2@aol.com (richardthiebaud)
Newsgroups: comp.lang.ada
Subject: Re: What does this error mean and how do I correct this?
Date: Fri, 1 Sep 2023 18:51:40 -0400
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uctpts$1p5s$1@dont-email.me>
References: <uctjkg$q7d$1@dont-email.me> <uctlr2$17md$1@dont-email.me>
<uctlvd$17md$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 1 Sep 2023 22:51:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="823760e972156cff7ec9afba8624fe7a";
logging-data="58556"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cuFLCV7WAvvZ0/0sM3lY5GN7aA7Mcc8w="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:ocabxu3KG/YyIuNe7ZokCTj3Igk=
Content-Language: en-US
In-Reply-To: <uctlvd$17md$2@dont-email.me>
 by: richardthiebaud - Fri, 1 Sep 2023 22:51 UTC

On 9/1/23 17:44, Luke A. Guest wrote:
> On 01/09/2023 22:41, Luke A. Guest wrote:
>> Handler needs to be in a package you with.
>>
>
>>> begin  -- Gtk.Init;
.....;
>>>
>>> test1.adb:32:17: subprogram must not be deeper than access type
>
> Ada doesn't like 'access types to be in an area that can go out of scope
> iirc. You can get around it with unchecked_access, but if you put
> handler into a package of it's own, it's at library level and is
> available to grab the access of.
>
That worked, thanks. Under gtkada, must procedures that handle events
always be in their own package?

Re: What does this error mean and how do I correct this?

<lyh6obfj0q.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9985&group=comp.lang.ada#9985

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: What does this error mean and how do I correct this?
Date: Sun, 03 Sep 2023 15:06:45 +0100
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <lyh6obfj0q.fsf@pushface.org>
References: <uctjkg$q7d$1@dont-email.me> <uctlr2$17md$1@dont-email.me>
<uctlvd$17md$2@dont-email.me> <uctpts$1p5s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="6a2b1a6fd88029b8df853eb412d8bcb0";
logging-data="1005784"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ECGvJRRyc6z4/oCeY9Mt2qGSJOARo3cY="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)
Cancel-Lock: sha1:cY46nn8wzDSmbYxJv6CxdbGpHQA=
sha1:PWESiBc7zfEuIXSKPnrM0BQKVuc=
 by: Simon Wright - Sun, 3 Sep 2023 14:06 UTC

richardthiebaud <thiebauddick2@aol.com> writes:

> Under gtkada, must procedures that handle events always be in their
> own package?

In general, they'd need to be in _a_ package. You could group related
event handlers in a package.

Re: What does this error mean and how do I correct this?

<ud28ba$vgcb$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9986&group=comp.lang.ada#9986

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: laguest@archeia.com (Luke A. Guest)
Newsgroups: comp.lang.ada
Subject: Re: What does this error mean and how do I correct this?
Date: Sun, 3 Sep 2023 16:22:17 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ud28ba$vgcb$1@dont-email.me>
References: <uctjkg$q7d$1@dont-email.me> <uctlr2$17md$1@dont-email.me>
<uctlvd$17md$2@dont-email.me> <uctpts$1p5s$1@dont-email.me>
<lyh6obfj0q.fsf@pushface.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 3 Sep 2023 15:22:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c536c190f6a3aaa5b7cec9893a5c0e45";
logging-data="1032587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GQzzw5vD1tGEGHP33/RzorNux7glIp8I="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
Cancel-Lock: sha1:7SInpdM8V6x1/2Ot17Tmcew4Tv8=
Content-Language: en-GB
In-Reply-To: <lyh6obfj0q.fsf@pushface.org>
 by: Luke A. Guest - Sun, 3 Sep 2023 15:22 UTC

On 03/09/2023 15:06, Simon Wright wrote:
> richardthiebaud <thiebauddick2@aol.com> writes:
>
>> Under gtkada, must procedures that handle events always be in their
>> own package?
>
> In general, they'd need to be in _a_ package. You could group related
> event handlers in a package.

It's because what is beteen this:

procedure test1 is

and

begin -- test1

is on the stack and therefore not in permanent memory.

Re: What does this error mean and how do I correct this?

<lycyyzf66j.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9987&group=comp.lang.ada#9987

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: What does this error mean and how do I correct this?
Date: Sun, 03 Sep 2023 19:44:04 +0100
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <lycyyzf66j.fsf@pushface.org>
References: <uctjkg$q7d$1@dont-email.me> <uctlr2$17md$1@dont-email.me>
<uctlvd$17md$2@dont-email.me> <uctpts$1p5s$1@dont-email.me>
<lyh6obfj0q.fsf@pushface.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="6a2b1a6fd88029b8df853eb412d8bcb0";
logging-data="1097390"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XgKT1k/eRFkgSzaPOSpwNisfDAqjDGGw="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)
Cancel-Lock: sha1:p5lDIdMm5Mp5XDhJ91B81rWtW4o=
sha1:sEzXUFmvEyOlTPPAHDGcxrv7ZoY=
 by: Simon Wright - Sun, 3 Sep 2023 18:44 UTC

Simon Wright <simon@pushface.org> writes:

> richardthiebaud <thiebauddick2@aol.com> writes:
>
>> Under gtkada, must procedures that handle events always be in their
>> own package?
>
> In general, they'd need to be in _a_ package. You could group related
> event handlers in a package.

I mean, if you had handlers for button A press & button A release they
could be grouped in one package. Int might make more sense for button B
event handlers to be grouped in another package. All depends on the
application

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor