[gtkada] Handler for tree view row expanded signal

Rob Groen robgr at xs4all.nl
Wed Dec 28 11:47:05 CET 2011


Hi,

I am trying to write a handler for the "row_expanded" signal in a tree 
view. According to documentation
the profile is
    --  - "row_expanded"
    --    procedure Handler (Widget : access Gtk_Tree_View_Record'Class;
    --       Iter : access Gtk.Tree_Iter.Gtk_Tree_Iter_Record'Class;
    --       Path : Gtk.Tree_Model.Gtk_Tree_Path);

(BTW: this is verbatim from the Gtk.Tree_View package. There is no 
Gtk.Tree_Iter package, declaration for Gtk_Tree_Iter is in 
Gtk.Tree_Model...)

Since there is no obvious way tp connect a handler with this profile I 
declared my handler as:

    procedure On_Tree_View_Row_Expanded
      (Object : access Gtk_Tree_View_Record'Class;
       Params : Gtk.Arguments.Gtk_Args);

Then, in the body I get the Path by

Tree_Path := Gtk_Tree_Path (Get_Proxy (Nth (Params, 1)));

3 questions:
1) getting the tree path in this way does not give a valid path
2) must the path be free'd by calling path_free ?
3) can I get the iter in a simular way, by extracting it from params 
(how?) or is the only way to use
Iter := <Model>.Get_Iter (Tree_Path);

Regards, Rob

-- 
Rob
---------------
Anything you try to fix will take longer and cost more than you thought

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/gtkada/attachments/20111228/028b8738/attachment.html 


More information about the gtkada mailing list