[gtkada] Addressing external data in a GUI

Rick Duley 30294025 at student.murdoch.edu.au
Tue Jul 12 09:31:50 CEST 2005


Hi Michael

Sorry about taking so long to get back to you.  Been ill.

Your e-mail provided a valuable clue to a process which is slowly becoming
clearer.  However, in your code (below) you included the line:

> ID :=  Gtk.Main.Timeout_Add (500, Display_Status'access); -- call it
> every 500ms

Question:  What does 'ID' represent here?

Thanks
-- 
-------------------------------------------
"Professional qualitative judgement
    consists in knowing the rules
      for using (or occasionally breaking)
        the rules."
                             D. Royce Sadler
-------------------------------------------
Rick Duley
Murdoch University
School of Engineering Science
Perth, Western Australia
http://eng.murdoch.edu.au/~rick
aussie : 040 910 6049                .-_|\
o'seas : + 61 40 910 6049           /     \
                               perth *_.-._/
                                          v


Quoting Michael Bode <michael.bode at laserline.de>:

>
> I do things like that using a protected type and a timer or idle procedure.
> In the worker package:
>
> type status_record is
>   -- status information
> end record;
>
> protected Status is
>     procedure set (S: status_record);
>     function get return status_record;
> end Status;
>
> and in the GUI package:
>
> function Display_Status return Boolean
> is
>   S : Status_Record;
> begin
>    Gdk.Threads.Enter;  -- timeout callback must call this
>    S := Some_Instance_of_Status.Get;
>    ...
>   Gdk.Threads.Leave; -- timeout callback must call this
>    return True;
> end Display_Status;
>
> ID :=  Gtk.Main.Timeout_Add (500, Display_Status'access); -- call it
> every 500ms
>
> Code not compiled, likely contains bugs.
>
> -- Michael Bode
> Laserline GmbH
> Fraunhoferstr.
> 56218 Mülheim-Kärlich
> Phone:     +49 2630 964-2200
> Fax:       +49 2630 964-2209
>
> _______________________________________________
> gtkada mailing list
> gtkada at lists.adacore.com
> http://lists.adacore.com/mailman/listinfo/gtkada
>





More information about the gtkada mailing list