mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* gtk/*.custom : return 0 length arrays, not null. svn path=/trunk/gtk-sharp/; revision=22992
25 lines
803 B
Plaintext
25 lines
803 B
Plaintext
// TreeSelection.custom - customizations to Gtk.TreeSelection
|
|
//
|
|
// Authors: Mike Kestner <mkestner@ximian.com>
|
|
//
|
|
// Copyright (c) 2004 Novell, Inc.
|
|
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
static extern IntPtr gtk_tree_selection_get_selected_rows (IntPtr raw, out IntPtr model);
|
|
|
|
public TreePath[] GetSelectedRows (out TreeModel model)
|
|
{
|
|
IntPtr model_handle;
|
|
IntPtr list_ptr = gtk_tree_selection_get_selected_rows (Handle, out model_handle);
|
|
model = (Gtk.TreeModel) GLib.Object.GetObject(model_handle);
|
|
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;
|
|
}
|
|
|