[gtkada] Gate model

Preben Randhol randhol at pvv.org
Thu May 3 10:55:33 CEST 2001


Julio Angel Cano Romero <jukano at visto.com> wrote on 02/05/2001 (12:18) :
> 
> Hi.
> 
> A few days ago I wrote a message about a gate (gtkada) bug. The problem seems to be that I use glade-gnome and even deactivating gnome support gate is unable to generate code using these glade-gnome files. Beside that I forgot to say which system I work on:
> Debian, kernel 2.4.3, gnat 3.13p2 and gtkada 1.2.8

I haven't experienced this problem. At the moment I use gtkada 1.2.11
and I can't downgrade to check, but when I used gtkada 1.2.8 I didn't
have this problem. You could try the 1.2.11 though you find it in the
unstable: http://packages.debian.org/unstable/devel/libgtkada1-dev.html

But have you tried using a glade without gnome?

> Should i instantiate the package window and then declare a second
> window to be instantiated?
> 
> ....  window1b : Window1_Access; ....  Gtk_New (window1); Gtk_New
> (window1b); ...

Just do:

   procedure main is
      Gui_Window1 : Gui_Window_Access;
      Gui_Window2 : Gui_Window_Access;
    begin
      ...
      Gtk_New (Gui_Window1);
      Gtk_New (Gui_Window2);
      Show_All (Gui_Window1);
      Show_All (Gui_Window2);
      ...
   end main;


> This seems to me as a posible cause of errors and mistakes because
> it's not so straightfordward but a king of patch.  I don't think that
> ignoring the "predefined" window1 varible should be ignored (anybody
> seen the "<p> declared but not used" warning?) to declare two window1
> variables.  What about using the same window interface but with
> different callbacks?  What about making window record components
> "private" just to be used by de window package procedures, or
> callbacks?

You don't need that variable at all if you don't want to use it.

you can comment out the variable in you Window package:

   procedure Gtk_New (Gui_Window : out Gui_Window_Access);
   procedure Initialize (Gui_Window : access Gui_Window_Record'Class);

   --   Gui_Window : Gui_Window_Access;

and declare the variable where you want it. Sometimes it is nice to have
this variable in the package as it is easier to get it. I mean you don't
need to pass it through all procedures / functions, but of course there
might be downsides to as you point out.

Hope it helps :-)

PS: I'm also installing Gnat + GtkAda on Windows now to test the
portability. Using Linux for development though :-)

-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»




More information about the gtkada mailing list