2004-02-11 Mike Kestner <mkestner@ximian.com>

* gtk/*.custom : don't use element_type ctor for GObject lists.

svn path=/trunk/gtk-sharp/; revision=22996
This commit is contained in:
Mike Kestner 2004-02-11 22:23:11 +00:00
parent 2419dff1d9
commit 835866aab8
6 changed files with 15 additions and 11 deletions

View file

@ -1,3 +1,7 @@
2004-02-11 Mike Kestner <mkestner@ximian.com>
* gtk/*.custom : don't use element_type ctor for GObject lists.
2004-02-11 Mike Kestner <mkestner@ximian.com> 2004-02-11 Mike Kestner <mkestner@ximian.com>
* gtk/*.custom : return 0 length arrays, not null. * gtk/*.custom : return 0 length arrays, not null.

View file

@ -13,7 +13,7 @@ public Widget[] Children {
if (list_ptr == IntPtr.Zero) if (list_ptr == IntPtr.Zero)
return new Widget [0]; return new Widget [0];
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.Widget)); GLib.List list = new GLib.List (list_ptr);
Widget[] result = new Widget [list.Count]; Widget[] result = new Widget [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Widget; result [i] = list [i] as Widget;
@ -34,14 +34,14 @@ public Widget[] FocusChain {
if (!success) if (!success)
return new Widget [0]; return new Widget [0];
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.Widget)); GLib.List list = new GLib.List (list_ptr);
Widget[] result = new Widget [list.Count]; Widget[] result = new Widget [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Widget; result [i] = list [i] as Widget;
return result; return result;
} }
set { set {
GLib.List list = new GLib.List (IntPtr.Zero, typeof (Gtk.Widget)); GLib.List list = new GLib.List (IntPtr.Zero);
foreach (Widget val in value) foreach (Widget val in value)
list.Append (val.Handle); list.Append (val.Handle);
gtk_container_set_focus_chain (Handle, list.Handle); gtk_container_set_focus_chain (Handle, list.Handle);

View file

@ -12,7 +12,7 @@
IntPtr raw_ret = gtk_text_child_anchor_get_widgets (Handle); IntPtr raw_ret = gtk_text_child_anchor_get_widgets (Handle);
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
return new Widget [0]; return new Widget [0];
GLib.List list = new GLib.List(raw_ret, typeof (Widget)); GLib.List list = new GLib.List(raw_ret);
Widget[] result = new Widget [list.Count]; Widget[] result = new Widget [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Widget; result [i] = list [i] as Widget;

View file

@ -23,7 +23,7 @@
IntPtr raw_ret = gtk_tree_view_get_columns (Handle); IntPtr raw_ret = gtk_tree_view_get_columns (Handle);
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
return new TreeViewColumn [0]; return new TreeViewColumn [0];
GLib.List list = new GLib.List (raw_ret, typeof (Gtk.TreeViewColumn)); GLib.List list = new GLib.List (raw_ret);
TreeViewColumn[] result = new TreeViewColumn [list.Count]; TreeViewColumn[] result = new TreeViewColumn [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as TreeViewColumn; result [i] = list [i] as TreeViewColumn;

View file

@ -40,7 +40,7 @@
IntPtr raw_ret = gtk_tree_view_column_get_cell_renderers (Handle); IntPtr raw_ret = gtk_tree_view_column_get_cell_renderers (Handle);
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
return new CellRenderer [0]; return new CellRenderer [0];
GLib.List list = new GLib.List (raw_ret, typeof (CellRenderer)); GLib.List list = new GLib.List (raw_ret);
CellRenderer[] result = new CellRenderer [list.Count]; CellRenderer[] result = new CellRenderer [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as CellRenderer; result [i] = list [i] as CellRenderer;

View file

@ -37,14 +37,14 @@
IntPtr raw_ret = gtk_window_get_default_icon_list(); IntPtr raw_ret = gtk_window_get_default_icon_list();
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
return new Gdk.Pixbuf [0]; return new Gdk.Pixbuf [0];
GLib.List list = new GLib.List(raw_ret, typeof (Gdk.Pixbuf)); GLib.List list = new GLib.List(raw_ret);
Gdk.Pixbuf[] result = new Gdk.Pixbuf [list.Count]; Gdk.Pixbuf[] result = new Gdk.Pixbuf [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Gdk.Pixbuf; result [i] = list [i] as Gdk.Pixbuf;
return result; return result;
} }
set { set {
GLib.List list = new GLib.List(IntPtr.Zero, typeof (Gdk.Pixbuf)); GLib.List list = new GLib.List(IntPtr.Zero);
foreach (Gdk.Pixbuf val in value) foreach (Gdk.Pixbuf val in value)
list.Append (val.Handle); list.Append (val.Handle);
gtk_window_set_default_icon_list(list.Handle); gtk_window_set_default_icon_list(list.Handle);
@ -73,14 +73,14 @@
IntPtr raw_ret = gtk_window_get_icon_list(Handle); IntPtr raw_ret = gtk_window_get_icon_list(Handle);
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
return new Gdk.Pixbuf [0]; return new Gdk.Pixbuf [0];
GLib.List list = new GLib.List(raw_ret, typeof (Gdk.Pixbuf)); GLib.List list = new GLib.List(raw_ret);
Gdk.Pixbuf[] result = new Gdk.Pixbuf [list.Count]; Gdk.Pixbuf[] result = new Gdk.Pixbuf [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Gdk.Pixbuf; result [i] = list [i] as Gdk.Pixbuf;
return result; return result;
} }
set { set {
GLib.List list = new GLib.List(IntPtr.Zero, typeof (Gdk.Pixbuf)); GLib.List list = new GLib.List(IntPtr.Zero);
foreach (Gdk.Pixbuf val in value) foreach (Gdk.Pixbuf val in value)
list.Append (val.Handle); list.Append (val.Handle);
gtk_window_set_icon_list(Handle, list.Handle); gtk_window_set_icon_list(Handle, list.Handle);
@ -116,7 +116,7 @@
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
return new Window [0]; return new Window [0];
GLib.List list = new GLib.List(raw_ret, typeof (Gtk.Window)); GLib.List list = new GLib.List(raw_ret);
Window[] result = new Window [list.Count]; Window[] result = new Window [list.Count];
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Window; result [i] = list [i] as Window;