mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-25 06:05:30 +00:00
2419dff1d9
* 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;
|
|
}
|
|
|