comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: gtkada and timeouts
Date: Fri, 1 Apr 2011 10:27:35 +0200
Date: 2011-04-01T10:27:33+02:00	[thread overview]
Message-ID: <tqxrfgq3w0l8$.y2dxfhcyme10.dlg@40tude.net> (raw)
In-Reply-To: 76005a0b-51c6-46c3-9cd3-976d7d7a050e@dr5g2000vbb.googlegroups.com

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. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-04-01  8:27 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 [this message]
2011-04-01  9:15   ` tonyg
2011-04-01  9:53     ` tonyg
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