diff --git a/ChangeLog b/ChangeLog index 994d25fa4..00787148a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-27 Mike Kestner + + * gtk/NodeSelection.cs : use new GetSelectedRows() overload. + * gtk/TreeSelection.custom : add a GetSelectedRows overload without the + out model param. [Fixes #71814] + 2005-01-27 Mike Kestner * gtk/NodeView.cs : fix the value creation in the ctor. diff --git a/doc/en/Gtk/TreeSelection.xml b/doc/en/Gtk/TreeSelection.xml index 051a7317e..ec25f7ff0 100644 --- a/doc/en/Gtk/TreeSelection.xml +++ b/doc/en/Gtk/TreeSelection.xml @@ -527,5 +527,18 @@ class TreeSelectionSample + + + Method + + Gtk.TreePath[] + + + + Returns an array of s representing the selected rows. + Selected rows in an array of s + + + - \ No newline at end of file + diff --git a/gtk/NodeSelection.cs b/gtk/NodeSelection.cs index 4409bdcad..a352c779c 100644 --- a/gtk/NodeSelection.cs +++ b/gtk/NodeSelection.cs @@ -119,8 +119,7 @@ namespace Gtk { public ITreeNode[] SelectedNodes { get { - TreeModel model; - TreePath [] paths = selection.GetSelectedRows (out model); + TreePath [] paths = selection.GetSelectedRows (); int length = paths.Length; ITreeNode [] results = new ITreeNode [length]; diff --git a/gtk/TreeSelection.custom b/gtk/TreeSelection.custom index 449a1063e..34c0f9ece 100644 --- a/gtk/TreeSelection.custom +++ b/gtk/TreeSelection.custom @@ -19,6 +19,22 @@ // Boston, MA 02111-1307, USA. + [DllImport("libgtk-win32-2.0-0.dll")] + static extern IntPtr gtk_tree_selection_get_selected_rows (IntPtr raw, IntPtr model); + + public TreePath[] GetSelectedRows () + { + IntPtr list_ptr = gtk_tree_selection_get_selected_rows (Handle, IntPtr.Zero); + if (list_ptr == IntPtr.Zero) + return new TreePath [0]; + + GLib.List list = new GLib.List (list_ptr, typeof (Gtk.TreePath)); + TreePath[] result = new TreePath [list.Count]; + for (int i = 0; i < list.Count; i++) + result [i] = (TreePath) list [i]; + return result; + } + [DllImport("libgtk-win32-2.0-0.dll")] static extern IntPtr gtk_tree_selection_get_selected_rows (IntPtr raw, out IntPtr model);