From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:a64d:: with SMTP id p74mr7749948qke.285.1572634048843; Fri, 01 Nov 2019 11:47:28 -0700 (PDT) X-Received: by 2002:a9d:5911:: with SMTP id t17mr9402142oth.82.1572634048631; Fri, 01 Nov 2019 11:47:28 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!feeder1.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!j16no586546qtl.0!news-out.google.com!g53ni234qtg.0!nntp.google.com!j16no586541qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 1 Nov 2019 11:47:28 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: gtkada3 callback function & failure : subprogram must not be deeper than access type From: Shark8 Injection-Date: Fri, 01 Nov 2019 18:47:28 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:57429 Date: 2019-11-01T11:47:28-07:00 List-Id: Move the On_Button_Click procedure to its own file (on-button-click.ads or = something) and add "With On_Button_Click;" to your hello_gtk procedure. The reason for the error "subprogram must not be deeper than access type" i= s because the subprogram's access-level is inside the scope of hello_gtk, b= ut the parameter's access-type exceeds that scope: IOW, the access failure = is to prevent the dangling-pointer situation where hello_gtk finishes and t= herefore leaves the scope (thus invalidating the reference to On_Button_Cli= ck).