GtkSharp/gtk/FileSelection.custom

64 lines
1.8 KiB
Text
Raw Normal View History

//
// Gtk.FileSelection.custom - Gtk FileSelection class customizations
//
// Author: Duncan Mak (duncan@ximian.com)
// Joe Shaw (joe@ximian.com)
//
// Copyright (C) 2002 Ximian, Inc.
//
// This code is inserted after the automatically generated code.
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
public class FSButton : Gtk.Button {
FileSelection file_sel;
public FileSelection FileSelection {
get { return file_sel; }
}
internal FSButton (FileSelection fs, IntPtr raw) : base (raw) {
file_sel = fs;
}
}
[DllImport("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_selection_get_selections (IntPtr handle);
[DllImport("libglib-2.0-0.dll")]
static extern void g_strfreev (IntPtr handle);
public string[] Selections {
get {
IntPtr strv = gtk_file_selection_get_selections (Handle);
System.Collections.ArrayList result = new System.Collections.ArrayList ();
int i = 0;
IntPtr strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
while (strptr != IntPtr.Zero) {
result.Add (GLib.Marshaller.FilenamePtrToString (strptr));
strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
}
g_strfreev (strv);
return result.ToArray (typeof (string)) as string[];
}
}