[gtkada] [gtkaa] more on row_activate for tree views
Dmitry A. Kazakov
mailbox at dmitry-kazakov.de
Fri Jun 24 21:39:57 CEST 2011
On Fri, 24 Jun 2011 20:32:22 +0200, you wrote:
> I have the following program (only the relevant parts are included):
>
> ...
> package Treeview_Callback is new Gtk.Handlers.Callback
> (Gtk_Tree_View_Record);
> ...
> Treeview_Callback.Connect (My_Treeview, "row_activated",
> On_Row_Activated'Access);
> ...
> procedure On_Row_Activated (Treeview : access Gtk_Tree_View_Record'Class;
> Params :
> Glib.Values.GValues)
> is
> Path_String : constant String := Get_String (Nth (Params, 1));
Shouldn't it rather be:
Path : Gtk_Tree_Path := Convert (Get_Address (Nth (Params, 1)));
> Model : Gtk_Tree_Store;
> Iter : Gtk_Tree_Iter;
> ...
> begin
> Model := Gtk_Tree_Store (Get_Model (Treeview));
> Iter := Get_Iter_From_String (Model, Path_String);
Iter := Get_Iter (Model, Path);
if Iter /= Null_Iter then
...
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
More information about the gtkada
mailing list