[gtkada] [gtkaa] more on row_activate for tree views

Juan L. Freniche fdesp87 at gmail.com
Fri Jun 24 22:23:21 CEST 2011


Thanks a lot! Tried and working!

Additional curiosity: why Can iter be null? I just double-clicked on a row!

El 24/06/2011 21:39, Dmitry A. Kazakov escribió:
> 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
>        ...
>



More information about the gtkada mailing list