[gtkada] Gate model

Julio Angel Cano Romero jukano at visto.com
Tue May 1 23:29:02 CEST 2001


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

Anyway i tested gtkada on other machine using glade (without gnome) and it works right. I installed gnat and gtkada on my windowze too, although i develop mainly on linux this kind of portability is pretty nice.

But the purpose of this message is other: the "model" of code generated by gate.
I am a newbe at ada. I have used glade (gui designer) in other projects but using C as target, so i am testing gtkada and gate.
I see that for every "window" is generated a package. This package containg a record with de window contents (labels, buttons, and so) and a variable for this kind of window record.
This way, main project file can do something like this:

   Gtk_New(window1);
   Gtl_New(window2);

And the windows are created and self initiated even without declaring any varible at main program.
This "model" makes no need to declare those variables, "encapsulates" the use of them and the most important: makes callback connections greatly easy.
But I still don't like it.

Let's suppose i want to instantiate two windows of the same class. Should i instantiate the package window and then declare a second window to be instantiated?

....
window1b : Window1_Access;
....
   Gtk_New (window1);
   Gtk_New (window1b);
...

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?

These are just a few opinions with my point of view. Remember I'm a newbe at ada and not so good programer. These things could be seen in another way, or don't be so important.

Flames accepted. :)
Bye.


___________________________________________________________________________
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.





More information about the gtkada mailing list