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-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,FREEMAIL_FROM, NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: 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 Message-ID: References: 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: Xref: news.eternal-september.org comp.lang.ada:65582 List-Id: 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?