[gtkada] Problems with Tree_Model and gate

Preben Randhol randhol+gtkada at pvv.org
Sun Jun 5 17:22:03 CEST 2005


Hi

I was using glade and gate to set a signal. The code generated by gate
is give compilation error though:


gnatgcc -c -I/usr/share/ada/adainclude/gtkada2 widget_pkg-callbacks.adb
widget_pkg-callbacks.adb:375:14: "Gtk_Tree_Iter" is not visible (more references follow)
widget_pkg-callbacks.adb:375:14: non-visible declaration at gtk-tree_model.ads:192
widget_pkg-callbacks.adb:376:14: "Gtk_Tree_Path" is not visible (more references follow)
widget_pkg-callbacks.adb:376:14: non-visible declaration at gtk-tree_model.ads:95
gnatmake: "widget_pkg-callbacks.adb" compilation error

I therefore add:

with Gtk.Tree_Model;  use Gtk.Tree_Model;

and compile again which gives:

gnatgcc -c -I/usr/share/ada/adainclude/gtkada2 widget_pkg-callbacks.adb
widget_pkg-callbacks.adb:375:31: prefix of "Val" attribute must be
discrete type
widget_pkg-callbacks.adb:376:31: prefix of "Val" attribute must be
discrete type
gnatmake: "widget_pkg-callbacks.adb" compilation error

The code made by gate looks like this:


   procedure On_Treeview1_Row_Expanded
     (Object : access Gtk_Tree_View_Record'Class;
      Params : Gtk.Arguments.Gtk_Args)
   is
      Arg1 : Gtk_Tree_Iter := Gtk_Tree_Iter'Val (To_Gint (Params, 1));
      Arg2 : Gtk_Tree_Path := Gtk_Tree_Path'Val (To_Gint (Params, 2));
   begin
      null;
   end On_Treeview1_Row_Expanded;


I have the same problem when trying to use the rows_reordered signal in
Tree_Model.

   procedure Rows_Reordered
     (Tree_Model         : access Gtk_Tree_Model_Record'Class;
      Path               :        Gtk_Tree_Path;
      Iter               :        Gtk_Tree_Iter;
      New_Order          :        Gint_Array);

Do you have any suggestions how to hook up this callback?

Thanks in advance.

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



More information about the gtkada mailing list