[Gtk-sharp-list] Can we make NodeStore.GetPath public?

Eric Butler firerabbit at gmail.com
Sat Sep 17 16:55:11 EDT 2005


Okay, thats fair enough, can I commit this then?

Index: gtk/NodeView.cs
===================================================================
--- gtk/NodeView.cs     (revision 50119)
+++ gtk/NodeView.cs     (working copy)
@@ -66,6 +66,12 @@
                        AppendColumn (col);
                        return col;
                }
+
+               public bool GetRowExpanded (ITreeNode node)
+               {
+                       Gtk.TreePath path = store.GetPath (node);
+                       return base.GetRowExpanded (path);
+               }
        }
 }



On 9/14/05, Ben Maurer <bmaurer at ximian.com> wrote:
> On Wed, 2005-09-14 at 10:32 -0700, Eric Butler wrote:
> > I'd like to check if a node in the NodeStore is expanded,
> > TreeView.GetRowExpanded takes a TreePath, but it doesnt look like
> > theres any way to get a TreeNode's path because there is no way to get
> > it's top-level index (Nodes.IndexOf). NodeStore already has a GetPath
> > method but its marked internal, can we change this to be public?
> 
> IMHO, the real solution is to offer a wrapper that takes a TreeNode. A
> consumer of NodeStore should *never* have to see a path.
> 
> I filed one similar bug:
> 
>                 view.RowExpanded += delegate (object o, RowExpandedArgs args) {
>                         TreeNode n = (TreeNode) Store.GetNode (args.Path);
>                         n.PopulateChildrenAsync ();
>                 };
> 
> Shows up in my msdn browser code. Really, the RowExpanded events should
> have the TreeNode as an argument, rather than forcing some incantation
> like this.
> 
> -- Ben
> 
>


More information about the Gtk-sharp-list mailing list