From: tonyg <tonythegair@gmail.com>
Subject: Re: gtkada and timeouts
Date: Fri, 1 Apr 2011 02:53:58 -0700 (PDT)
Date: 2011-04-01T02:53:58-07:00 [thread overview]
Message-ID: <e65a4f0f-ef74-4ef1-9ee9-177ac3e5e661@dr5g2000vbb.googlegroups.com> (raw)
In-Reply-To: 02b5da0a-b640-4b44-bdb5-026acf923e00@32g2000vbe.googlegroups.com
On Apr 1, 10:15 am, tonyg <tonytheg...@gmail.com> wrote:
> On Apr 1, 9:27 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>
>
>
> > On Fri, 1 Apr 2011 01:09:36 -0700 (PDT), tonyg wrote:
> > > I've written a function called update_screen which always returns a
> > > value of true and sets various values in the 'main_screen' access
> > > record. This is part of the code from glade/gate which I have modified
> > > to include a timeout
>
> > > with Gtk; use Gtk;
> > > with Gtk; use Gtk;
> > > with Gtk.Main; use Gtk.Main;
> > > with Gtk.Widget; use Gtk.Widget;
> > > with Main_Screen_Pkg; use Main_Screen_Pkg;
> > > with Main_Control; use Main_Control;
> > > procedure Main_Screen is
> > > Main_Screen : Main_Screen_Access;
> > > Timeout_Id : Timeout_Handler_id ;
> > > package Data_Timeout is new Gtk.Main.Timeout (Main_Screen_Access);
>
> > > begin
> > > Gtk.Main.Set_Locale;
> > > Gtk.Main.Init;
> > > Gtk_New (Main_Screen);
> > > Show_All (Main_Screen);
> > > Gtk.Main.Main;
> > > -- my addition -- the timer
> > > Timeout_Id := Data_Timeout.Add (100, Update_Screen'Access,
> > > Main_Screen);
>
> > > end Main_Screen;
>
> > > Sadly the timeout is never called, Can anyone cast some light on this?
>
> > The procedure Gtk.Main.Main runs infinite messages loop. You should add
> > timers before entering the loop.
>
> > --
> > Regards,
> > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de
>
> I tried placing it just before the Gtk.Main.Main and the whole app
> locked up. I'm going to put it now in the initialise procedure than
> gate creates in the _pkg.adb.
Thanks Guys, that bits working now and I have moved on to my next self
inflicted bug ! :)
next prev parent reply other threads:[~2011-04-01 9:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 8:09 gtkada and timeouts tonyg
2011-04-01 8:27 ` Dmitry A. Kazakov
2011-04-01 9:15 ` tonyg
2011-04-01 9:53 ` tonyg [this message]
2011-04-01 8:50 ` Julian Leyh
2011-04-02 1:37 ` Randy Brukardt
2011-04-02 8:21 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox