From: "Nick Roberts" <nick.roberts@acm.org>
Subject: Re: GtkAda Problem
Date: Sat, 17 Jul 2004 21:00:38 +0100
Date: 2004-07-17T21:00:38+01:00 [thread overview]
Message-ID: <opsbasjcn6p4pfvb@bram-2> (raw)
In-Reply-To: 1udKc.98748$dP1.333832@newsc.telia.net
On Sat, 17 Jul 2004 17:38:05 GMT, Bj�rn Persson <spam-away@nowhere.nil>
wrote:
> Oliver Doerler wrote:
>
>> fidle_id := Gtk.Main.Idle_Add (fidle'access);
>> gnatmake Message:
>> =>subprogram must not be deeper than access type
>
> Did you declare fidle inside the main subprogram? Move it to a package.
> Idle_Callback is defined on what is called the library level. It's not
> allowed to point to something on a deeper level, and what's inside a
> subprogram is deeper. The rule is there to prevent pointers from
> pointing to something that can go out of scope and disappear before the
> pointer goes out of scope.
>
> I think most beginners try to do this and get confused. I know I did.
If it is possible to move fidle to a library-level package, fine. But
if it would be impractical to do so, I suspect using Unchecked_Access
is the best bet.
--
Nick Roberts
next prev parent reply other threads:[~2004-07-17 20:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-17 16:05 GtkAda Problem Oliver Doerler
2004-07-17 16:11 ` Sorry wrong Def.! Oliver Doerler
2004-07-17 17:38 ` GtkAda Problem Björn Persson
2004-07-17 20:00 ` Nick Roberts [this message]
2004-07-17 22:40 ` Jeffrey Carter
2004-07-18 0:01 ` Nick Roberts
2004-07-18 11:29 ` Simon Wright
2004-07-18 14:17 ` Nick Roberts
2004-07-19 19:55 ` Warren W. Gay VE3WWG
2004-07-19 21:58 ` Ludovic Brenta
2004-07-19 22:59 ` Ed Falis
2004-07-20 16:58 ` Warren W. Gay VE3WWG
2004-07-20 18:14 ` Nick Roberts
2004-07-19 23:55 ` Randy Brukardt
2004-07-17 17:44 ` Nick Roberts
2004-07-21 20:15 ` Oliver Doerler
-- strict thread matches above, loose matches on Subject: below --
2003-01-07 11:45 gtkada problem Evangelista Sami
2003-01-07 18:46 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox